/*! shop_admin 2019-05-16 */
define("/common/js/app", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //注册组件 , 帖子列表
    var app = function(params) {
        app.wxLoad = null;
        //app.wx = require("jweixin");
        app.params = {
            versions: "6.7",
            userVersions: "2.4",
            urlChangeFromComponent: 1,
            debug: true,
            urlCache: {},
            loadPage: 0,
            plugUrl: "/",
            bindPhone: false,
            apiDomain: "http://tenement.com/",
            //不带"/"
            //domain: 'http://www.codecamp.com', 
            loginUrl: "https://login.bestsmartbee.com/"
        };
        for (var i in params) {
            app.params[i] = params[i];
        }
        app.pageData = {};
        var fun = {
            setWxShareData: function() {
                if (!app.isWeiXin()) {
                    return;
                }
                if (app.params.DefShareData) {
                    app.wxDefShare(app.params.DefShareData);
                } else {}
            },
            isWeiXin: function() {
                //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息，这个属性可以用来判断浏览器类型
                var ua = window.navigator.userAgent.toLowerCase();
                //通过正则表达式匹配ua中是否含有MicroMessenger字符串
                if (ua.match(/MicroMessenger/i) == "micromessenger") {
                    return true;
                } else {
                    return false;
                }
            },
            isAlipay: function() {
                //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息，这个属性可以用来判断浏览器类型
                var ua = window.navigator.userAgent.toLowerCase();
                if (ua.match(/Alipay/i) == "alipay") {
                    return true;
                } else {
                    return false;
                }
            },
            //实例化VueApp
            init: function() {
                //创建和挂载根实例
                var VueApp = new Vue({
                    router: router,
                    watch: {
                        // 如果路由有变化，会再次执行该方法
                        $route: "fetchData"
                    },
                    mounted: function() {
                        this.fetchData();
                        app.setWxShareData();
                    },
                    methods: {
                        fetchData: function() {
                            //  console.log(this.$route);
                            var name = this.$route.name;
                            var options = app.findOptionsByName(name);
                            if (!options.name) {
                                return;
                            }
                            var hash = window.location.hash;
                            if (hash && hash.indexOf("component_") > -1) {
                                return false;
                            }
                            var id = "#page" + app.ucfirst(name);
                            var wrap = "#router-view-tmp";
                            //页面是要缓存的
                            if (options.page == "cache") {
                                wrap = "#router-view-cache";
                            } else {
                                wrap = "#router-view-tmp";
                                // 如果是组件路由发生变化，不清缓存
                                // if(app.params.urlChangeFromComponent==1){
                                //     $(wrap).html("");
                                // }
                                // console.log(app.params.preRoute);
                                // if ($(id).length > 0  && $(id).attr('url') !=window.location.href) {
                                //    var url = $(id).attr('url');
                                //    $(id).remove();
                                // }
                                if ($(id).length > 0) {
                                    $(id).remove();
                                }
                            }
                            if ($(id).length > 0 && $(id).attr("url") != window.location.href) {
                                var url = $(id).attr("url");
                                $(id).remove();
                            }
                            app.params.preRoute = name;
                            $(".page").addClass("cached").removeClass("pageShow");
                            var loadingPage = '<div class="loadingPage" style="text-align: center;margin-top: 100px;">正在为您努力加载页面。。。。</div>';
                            $("body").append(loadingPage);
                            if (options.title) {
                                app.setTitle(options.title);
                            }
                            if ($(id).length > 0) {
                                $(id).removeClass("cached").addClass("pageShow");
                                $(".loadingPage").remove();
                                var pageVm = app.getVm(name);
                                if (pageVm) {
                                    typeof pageVm.pageShow === "function" ? pageVm.pageShow() : "";
                                }
                                if (typeof app.pageShow == "function") {
                                    app.pageShow({
                                        name: name,
                                        vm: pageVm
                                    });
                                }
                            } else {
                                app.routePage(name, wrap);
                            }
                        }
                    }
                }).$mount("#app");
                if (typeof app.afterInit == "function") {
                    app.afterInit();
                }
            },
            // 加载组件
            component: function(name, params) {
                // app.params.urlChangeFromComponent=1;
                require.async("/component/template_js/" + name, function(html) {
                    // console.log(html);
                    var id = "component_" + name;
                    app.popup(id, html, "body");
                    window.location.href = "#" + id;
                    $(".popupBg").remove();
                    require.async("/component/" + name, function(component) {
                        component.vue(params);
                        // app.params.urlChangeFromComponent=0;
                        $("#" + id).addClass("page").addClass("popup_page");
                    });
                });
            },
            wxShare: function(params, callblack) {
                var data = {
                    title: params["title"],
                    // 分享标题
                    link: params["url"] ? params["url"] : window.location.href,
                    // 分享链接
                    imgUrl: params["imgUrl"],
                    // 分享图标
                    desc: params["desc"],
                    success: function() {},
                    cancel: function() {}
                };
                app.wx(function(wx) {
                    // console.log(data);
                    wx.onMenuShareTimeline(data);
                    wx.onMenuShareAppMessage(data);
                    callblack ? callblack() : "";
                });
            },
            wx: function(callblack) {
                require.async("jweixin", function(wx) {
                    app.wx = wx;
                    typeof callblack == "function" ? callblack(wx) : "";
                });
            },
            //传入一个name ， 会加载对应的html ,和js , 生成id : page-id
            routePage: function(name, wrap, ajax) {
                if (!name) {
                    return false;
                }
                // console.log(name);
                // component
                // 默认的
                if (!wrap) {
                    wrap = "#router-view-tmp";
                }
                var id = "page" + app.ucfirst(name);
                console.log("template_js/" + name);
                require.async("template_js/" + name, function(content) {
                    if (typeof content == "string") {
                        content = content.replace(/<img/g, "<img onerror=\"javascript:this.src='https://img.bestsmartbee.com/1536138807127'\" ");
                    }
                    var url = window.location.href;
                    if (ajax == 1) {
                        content = $("<div>" + content + "</div>").find(".ajaxPageContent").html();
                        content = "<div url=" + url + " id='" + id + "'>" + content + "</div>";
                    } else {
                        content = "<div url=" + url + " class='page pageShow' id='" + id + "'>" + content + "</div>";
                    }
                    var wrapContent = $(content);
                    $(wrapContent).hide();
                    $(wrapContent).appendTo(wrap);
                    var pageId = "#" + id;
                    var options = {
                        name: name
                    };
                    // console.log("js/" + name);
                    require.async("js/" + name, function(controller) {
                        // console.log(options);
                        // console.log(options,controller.pageShow);
                        controller.vue(options);
                        var vm = controller.vm;
                        $(pageId).show();
                        $(".loadingPage").remove();
                        if ($(pageId).find(".page-content").length > 0) {
                            app.scrollPreventDefault($(pageId).find(".page-content").eq(0));
                        }
                        if (typeof vm.pageShow == "function") {
                            vm.pageShow(options);
                        }
                        if (typeof app.pageShow == "function") {
                            options.vm = controller.vm;
                            app.pageShow(options);
                        }
                    });
                });
            },
            //禁用滚动
            scrollPreventDefault: function(pageContent) {
                function pageContentTouchstart() {
                    var el = this;
                    var top = el.scrollTop, totalScroll = el.scrollHeight, currentScroll = top + el.offsetHeight;
                    if (top === 0) {
                        $(el).attr("_isScroller", 1);
                        el.scrollTop = 2;
                    } else if (currentScroll === totalScroll) {
                        $(el).attr("_isScroller", 1);
                        el.scrollTop = top - 2;
                    }
                }
                function pageContentTouchmove() {
                    var el = this;
                    var top = el.scrollTop, totalScroll = el.scrollHeight, currentScroll = top + el.offsetHeight;
                    if (top === 0) {
                        $(el).attr("_isScroller", 0);
                    } else if (currentScroll === totalScroll) {
                        $(el).attr("_isScroller", 0);
                    }
                }
                function preventDefault(evt) {
                    var _isScroller = $(".pageShow .page-content").attr("_isScroller");
                    //pageContent 滚动到底部或顶部时禁用滚动
                    if (_isScroller == "0") {
                        evt.preventDefault();
                    }
                }
                //判断pageContent 滚动的位置， 如果滚动到顶部或底部， 禁用滚动
                $(pageContent).unbind("touchstart", pageContentTouchstart).bind("touchstart", pageContentTouchstart);
                $(pageContent).unbind("touchmove", pageContentTouchmove).bind("touchstart", pageContentTouchmove);
                //当pageContent顶部或底部， body是不能能滚动
                $("body").unbind("touchmove", preventDefault).bind("touchmove", preventDefault);
                //评价用户作品添加滚动效果
                // $(".add-comment-info").on("touchmove", function(event) {
                //     event.stopPropagation();
                // });
                // $(".add-comment-info").on("touchend", function(event) {
                //     event.stopPropagation();
                //     document.body.scrollTop = 0;
                // });
                //头部不能能滚动
                $("#header").unbind("touchmove").bind("touchmove", function(evt) {
                    evt.preventDefault();
                });
                //底部不能能滚动
                $(".bottom-fixed").unbind("touchmove").bind("touchmove", function(evt) {
                    evt.preventDefault();
                });
            },
            //找到这路由的配置
            findOptionsByName: function(name) {
                var options = router.options.routes;
                for (var item in options) {
                    if (name == options[item]["name"]) {
                        return options[item];
                    }
                }
                return {};
            },
            confirm: function(params) {
                //  $(".confirm").remove();
                // $("body").find(".popupBg").remove();
                var confirmText = params.confirmText ? params.confirmText : "确定";
                var cancelText = params.cancelText ? params.cancelText : "取消";
                var html = '<div class="confirm" id="appConfirm">';
                html += '<div class="confirm-text">' + params.text + "</div>";
                html += '<ul class="confirm-options">';
                html += '<li class="bl">' + cancelText + "</li> <li>" + confirmText + "</li>";
                html += "</ul>";
                html += "</div>";
                var yes = params.yes;
                $("body").append(html);
                // if ($("body").find(".popupBg").length > 0) {
                //     $("body").find(".popupBg").remove();
                // }
                $('<div class="popupBg"></div>').insertBefore("#appConfirm");
                $(".popupBg").unbind("click").bind("click", function() {
                    app.confirmNo();
                });
                $("#appConfirm .confirm-options li").eq(0).click(function() {
                    app.confirmNo(params.no);
                });
                var left = $(".confirm").width() / 2;
                $(".confirm").css("margin-left", "-" + left + "px");
                $("#appConfirm .confirm-options li").eq(1).click(function() {
                    app.confirmNo();
                    yes ? yes() : "";
                });
            },
            confirmNo: function() {
                $(".confirm").remove();
                $("body").find(".popupBg").remove();
            },
            //操作选项
            handle: function(params) {
                var optionsHtml = "";
                for (var i in params) {
                    optionsHtml += '<div class="handle-options-one">' + params[i]["text"] + "</div>";
                }
                var html = '<div class="handle-options">';
                html += '<div class="handle-options-group">';
                html += optionsHtml;
                html += " </div>";
                html += '<div class="handle-options-last colse">取消</div>';
                html += " </div>";
                app.popup("handle", html);
                $(".handle-options-one").click(function() {
                    var callblack = params[$(this).index()]["methods"];
                    callblack ? callblack() : "";
                    $("#handle").prev().remove();
                    $("#handle").remove();
                });
            },
            colseHandle: function() {
                $("body").find(".popupBg").remove();
                $("#handle").remove();
            },
            //popup 弹出方式
            popup: function(id, content, container) {
                if ($("body").find("#" + id).length > 0) {
                    $("body").find("#" + id).remove();
                }
                var html = '<div class="popup" id="' + id + '">' + content + "</div>";
                if (container) {
                    $(container).append(html);
                } else {
                    $(".pageShow").append(html);
                }
                app.show_popup("#" + id);
            },
            //
            show_popup: function(popupId) {
                if ($("body").find(".popupBg").length > 0) {
                    $("body").find(".popupBg").remove();
                }
                $('<div class="popupBg"></div>').insertBefore(popupId);
                $(popupId).addClass("popup-modal-in");
                $(".popupBg").bind("click", function() {
                    app.hide_popup();
                });
                $(popupId).find(".colse").bind("click", function() {
                    app.hide_popup();
                });
            },
            hide_popup: function() {
                $(".popup").removeClass("popup-modal-in");
                $("body").find(".popupBg").remove();
            },
            //图片加载延迟
            picLazyLoad: function(imgs, fn) {
                require.async("plug/picLazyLoad", function(picLazyLoad) {
                    picLazyLoad.watch(imgs, fn);
                });
            },
            //copy  //  data-clipboard-text="Just because you can doesn't mean you should — clipboard.js"
            copy: function(id, callblack) {
                require.async("/plug/clipboard.min", function(clipboard) {
                    var clipboard = new ClipboardJS(id);
                    clipboard.on("success", function(e) {
                        e.clearSelection();
                        callblack ? callblack("success") : "";
                    });
                    clipboard.on("error", function(e) {
                        callblack ? callblack("error") : "";
                    });
                });
            },
            //首字母大写
            ucfirst: function(str) {
                if (typeof str !== "string") {
                    return "";
                }
                var strs = str.split("/");
                var res = "";
                for (var i in strs) {
                    str = strs[i];
                    //var str = str.toLowerCase();
                    str = str.replace(/\b\w+\b/g, function(word) {
                        return word.substring(0, 1).toUpperCase() + word.substring(1);
                    });
                    res += str;
                }
                return res;
            },
            setTitle: function(title) {
                $("#app-title").text(title);
                $("title").html(title);
            },
            showLoad: function() {
                //$("body").append("<div class='dialog loading'></div>");
                var html = '<div class="loader loader--style1" title="0">';
                html += '<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"';
                html += ' width="40px" height="40px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">';
                html += '<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946';
                html += "  s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634";
                html += ' c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"/>';
                html += '<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0';
                html += '   C22.32,8.481,24.301,9.057,26.013,10.047z">';
                html += ' <animateTransform attributeType="xml"';
                html += '  attributeName="transform"';
                html += '  type="rotate"';
                html += ' from="0 20 20"';
                html += ' to="360 20 20"';
                html += ' dur="0.5s"';
                html += ' repeatCount="indefinite"/>';
                html += " </path>";
                html += "</svg>";
                html += "</div>";
                if ($("body").find(".loader--style1").length === 0) {
                    $("body").append(html);
                }
                $(".loader--style1").show();
            },
            hideLoad: function() {
                //$(".loading").remove();
                $(".loader--style1").hide();
            },
            //检查TOKEN 是否过期
            checkToken: function(callblack) {
                app.get("apiv2/user/checkToken", function(res) {
                    if (res.code != 200) {
                        app.delUserInfo();
                        app.auth();
                    } else {
                        callblack ? callblack() : "";
                    }
                });
            },
            login: function(callblack, fields) {
                var backUrl = window.location.href;
                var box_login_code = "";
                var Request = app.GetRequest(backUrl);
                var UserInfo = app.getUserInfo();
                // console.log("UserInfo:",UserInfo);
                if (UserInfo && UserInfo.user_id) {
                    app.checkToken(function() {
                        typeof callblack == "function" ? callblack(UserInfo) : "";
                    });
                } else if (Request && Request.token) {
                    app.loginByToken(Request.token, fields, callblack);
                } else {
                    app.auth();
                }
            },
            loginByToken: function(token, fields, callblack) {
                var userInfoUrl = app.params.loginUrl + "index/getUserInfoByToken/";
                app.showLoad();
                $.ajax({
                    url: userInfoUrl,
                    //可以不是本地域名 
                    type: "get",
                    data: {
                        fields: fields ? fields : "user_id,store_id,phone,nickname,phone,avatarUrl",
                        token: token
                    },
                    dataType: "jsonp",
                    //jsonp格式访问
                    success: function(data) {
                        if (data.code > 0) {
                            app.alert(data.msg);
                            app.relogin();
                        } else {
                            app.setUserInfo(data.userInfo);
                            app.hideLoad();
                            typeof callblack == "function" ? callblack(data.userInfo) : "";
                            if (app.params.bindPhone && !data.userInfo.phone) {
                                app.bindPhone();
                            }
                        }
                    },
                    error: function() {
                        app.relogin();
                    }
                });
            },
            relogin: function(text) {
                app.confirm({
                    text: text ? text : "授权登录发现异常，是否重新登录？",
                    yes: function() {
                        app.auth();
                    }
                });
            },
            auth: function() {
                var backUrl = window.location.href;
                var search = app.GetRequest(window.location.search);
                var store_id = search.store_id ? search.store_id : 0;
                var scene_id = search.scene_id ? search.scene_id : 0;
                var loginUrl;
                if (app.isWeiXin()) {
                    loginUrl = app.params.loginUrl + "index/getopenid/?backUrl=" + window.escape(backUrl);
                } else if (app.isAlipay()) {
                    loginUrl = app.params.loginUrl + "index/loginH5ByAlipay/?act=getUserId&backUrl=" + window.escape(backUrl);
                } else {
                    loginUrl = app.params.loginUrl + "index/synclogin/?backUrl=" + window.escape(backUrl);
                }
                if (store_id != 0) {
                    loginUrl += "&store_id=" + store_id;
                } else if (scene_id != 0) {
                    loginUrl += "&scene_id=" + scene_id;
                }
                window.location.href = loginUrl;
            },
            getStoreId: function() {
                var search = app.GetRequest(window.location.search);
                var store_id = search.store_id ? search.store_id : 0;
                return store_id;
            },
            getStore: function(callback) {
                var store_id = app.getStoreId();
                app.get("api/user/getStore", {
                    store_id: store_id
                }, function(res) {
                    callback ? callback(res.data) : "";
                });
            },
            getAppId: function() {
                var Request = app.GetRequest(window.location.href);
                if (Request.appId) {
                    return Request.appId;
                } else {
                    return "";
                }
            },
            wxJs: function(callblack) {
                if (app.wxLoad) {
                    typeof callblack == "function" ? callblack(app.wx) : "";
                    return;
                }
                app.get("api/wechat_tool/wxJs", function(signPackage) {
                    app.wx(function(wx) {
                        app.wxLoad = 1;
                        wx.config({
                            debug: false,
                            appId: signPackage.appId,
                            timestamp: signPackage.timestamp,
                            nonceStr: signPackage.nonceStr,
                            signature: signPackage.signature,
                            jsApiList: [ "onMenuShareTimeline", "onMenuShareAppMessage", "addCard", "chooseCard", "openCard", "chooseWXPay", "previewImage", "openLocation", "getLocation", "openAddress" ]
                        });
                        wx.ready(function() {
                            //alert(callblack);
                            typeof callblack == "function" ? callblack(wx) : "";
                        });
                        wx.error(function(res) {
                            //alert(callblack);
                            app.wxLoad = 0;
                            app.saveLog(res);
                            app.alert(res.errMsg);
                        });
                    });
                });
            },
            GetRequest: function(url) {
                var theRequest = new Object();
                if (url.indexOf("?") != -1) {
                    var str = url.split("?");
                    str = str[1];
                    var strs = str.split("&");
                    for (var i = 0; i < strs.length; i++) {
                        var v = strs[i].split("=")[1];
                        theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
                    }
                }
                return theRequest;
            },
            alert: function(msg, callblack) {
                //alert("<div class='dialog'>"+msg+"</div>");
                if (typeof msg != "string") {
                    msg = JSON.stringify(msg);
                }
                $("body").append("<div class='dialog'>" + msg + "</div>");
                var width = $(".dialog").width() / 2;
                var h = $(".dialog").height() / 2;
                $(".dialog").css({
                    "margin-left": "-" + width + "px",
                    "margin-top": "-" + h + "px"
                });
                setTimeout(function() {
                    $(".dialog").remove();
                    typeof callblack == "function" ? callblack() : "";
                }, 1e3);
            },
            //版本号
            getVersions: function() {
                return app.params.versions;
            },
            //用户信息
            getUserInfo: function(type) {
                var store_id = app.getStoreId();
                var userVersions = app.params.userVersions + store_id;
                console.log("userVersions:", userVersions);
                var UserInfo = app.cache(userVersions).get("UserInfo");
                if (UserInfo && UserInfo.token) {
                    //callblack ? callblack(UserInfo) : "";
                    // UserInfo.user_id = 36;
                    // UserInfo.token='cca001ac8014eb17284d9545335abe12';
                    return UserInfo;
                }
                return {};
            },
            setUserInfo: function(userInfo) {
                // var userVersions = app.params.userVersions;
                var store_id = app.getStoreId();
                var userVersions = app.params.userVersions + store_id;
                if (userInfo && userInfo.user_id && userInfo.token) {
                    var search = app.GetRequest(window.location.search);
                    delete search.token;
                    $.extend(userInfo, search);
                    var UserInfo = app.cache(userVersions).set("UserInfo", userInfo);
                }
            },
            delUserInfo: function(userInfo) {
                // var userVersions = app.params.userVersions;
                var store_id = app.getStoreId();
                var userVersions = app.params.userVersions + store_id;
                app.cache(userVersions).rm("UserInfo");
            },
            get: function(url, params, callblack) {
                app.showLoad();
                // console.log(params);
                var args = typeof params == "object" ? params : {};
                callblack = $.isFunction(params) ? params : callblack;
                var UserInfo = app.getUserInfo();
                if (UserInfo && UserInfo.token) {
                    args.token = UserInfo.token;
                }
                app.ajax({
                    type: "GET",
                    dataType: "json",
                    data: args,
                    success: function(res) {
                        // console.log(res);
                        callblack(res);
                    },
                    url: app.params.apiDomain + url
                });
            },
            post: function(url, params, callblack) {
                app.showLoad();
                // console.log(params);
                var args = typeof params == "object" ? params : {};
                callblack = $.isFunction(params) ? params : callblack;
                app.ajax({
                    type: "POST",
                    dataType: "json",
                    data: args,
                    success: function(res) {
                        callblack(res);
                    },
                    url: app.params.apiDomain + url
                });
            },
            loadCss: function(url) {
                url = app.params.plugUrl + url;
                var css_id = app.base64_encode(url);
                if (!app.params.urlCache[css_id]) {
                    app.params.urlCache[css_id] = css_id;
                    $("head").append('<link href="' + url + '" id="css_id_' + css_id + '" rel="stylesheet" type="text/css" />');
                }
            },
            //无限加载
            pager: function(id, callblack) {
                //$(window).unbind('scroll');
                function pagerContent() {
                    var bot = 100;
                    //bot是底部距离的高度
                    var nDivHight = $(this).height();
                    var nScrollHight = $(this)[0].scrollHeight;
                    var nScrollTop = $(this)[0].scrollTop;
                    if (nScrollTop + nDivHight + bot >= nScrollHight && app.params.loadPage == "0") {
                        $.isFunction(callblack) ? callblack() : "";
                    }
                }
                // console.log(id);
                $(id).find(".page-content").unbind("scroll", pagerContent);
                $(id).find(".page-content").scroll(pagerContent);
            },
            picker: function(id, params) {
                app.loadCss("plug/weui2/css/picker.css");
                // console.log(app.params.plugUrl +"plug/weui2/js/zepto.weui.min.js");
                app.getScript("plug/weui2/js/zepto.weui.min.js", function() {
                    $(id).picker(params);
                });
            },
            datetimePickerWap: function(id, params) {
                app.loadCss("plug/weui2/css/picker.css");
                app.getScript("plug/weui2/js/zepto.weui.min.js", function() {
                    $(id).datetimePicker(params);
                });
            },
            cityPicker: function(id, params) {
                app.loadCss("plug/weui2/css/picker.css");
                app.getScript("plug/weui2/js/zepto.weui.min.js", function() {
                    app.getScript("plug/weui2/js/picker.city.js", function() {
                        $(id).cityPicker(params);
                    });
                });
            },
            upload: function(obj, callblack) {
                app.loadCss("plug/photo/photo.css");
                require.async(app.params.plugUrl + "plug/photo/photo.js", function(photo) {
                    photo.initUpload($(obj));
                    callblack ? callblack() : "";
                });
            },
            MultipleUpload: function(obj, callblack) {
                app.loadCss("plug/photo/photo.css");
                require.async(app.params.plugUrl + "plug/photo/photo.js", function(photo) {
                    photo.initMultipleUpload($(obj));
                    callblack ? callblack() : "";
                });
            },
            //时间插件
            datetimepicker: function(_this) {
                app.loadCss("plug/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css");
                app.loadCss("plug/bootstrap-datetimepicker/css/datetimepicker.css");
                app.getScript("plug/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js", function() {
                    app.getScript("plug/bootstrap-datetimepicker/js/bootstrap-datetimepicker.zh-CN.js", function() {
                        $(_this).datetimepicker({
                            language: "zh-CN",
                            autoclose: 1,
                            minView: $(_this).attr("data-minview") ? $(_this).attr("data-minview") : 2
                        });
                    });
                });
            },
            lCalendar: function(id) {
                app.loadCss("plug/lCalendar.css");
                app.getScript("plug/lCalendar.min.js", function() {
                    var calendar = new lCalendar();
                    // alert($("#"+id).attr("type"));
                    calendar.init({
                        trigger: "#" + id,
                        type: $("#" + id).attr("data-type") ? $("#" + id).attr("data-type") : "date"
                    });
                });
            },
            _getScript: function(url, callback) {
                var head = document.getElementsByTagName("head")[0], js = document.createElement("script");
                js.setAttribute("type", "text/javascript");
                js.setAttribute("src", url);
                head.appendChild(js);
                //执行回调
                var callbackFn = function() {
                    if (typeof callback === "function") {
                        callback();
                    }
                };
                if (document.all) {
                    //IE
                    js.onreadystatechange = function() {
                        if (js.readyState == "loaded" || js.readyState == "complete") {
                            callbackFn();
                        }
                    };
                } else {
                    js.onload = function() {
                        callbackFn();
                    };
                }
            },
            //加载js
            getScript: function(url, callblack, versions) {
                url = app.params.plugUrl + url;
                app._getScript(url, function() {
                    callblack ? callblack() : "";
                });
            },
            ajax: function(params) {
                var userInfo = app.getUserInfo();
                var userInfoSearch = {};
                var search = app.GetRequest(window.location.search);
                delete search.token;
                if (userInfo) {
                    userInfoSearch = {
                        store_id: userInfo.store_id,
                        token: userInfo.token
                    };
                    if (userInfo.appid) {
                        userInfoSearch.appid = userInfo.appid;
                    }
                    if (userInfo.appid) {
                        userInfoSearch.openid = userInfo.openid;
                    }
                }
                // console.log(userInfoSearch);
                // return;
                $.extend(userInfoSearch, search);
                params = params ? params : {};
                if ($.isArray(params["data"])) {
                    for (var i in params["data"]) {
                        // userInfoSearch.push({
                        //       name:i,
                        //       value:params["data"][i]
                        //   });
                        userInfoSearch[params["data"][i]["name"]] = params["data"][i]["value"];
                    }
                    params["data"] = userInfoSearch;
                } else {
                    $.extend(userInfoSearch, params["data"]);
                    params["data"] = userInfoSearch;
                }
                console.log(userInfoSearch);
                var ajaxTimeoutTest = $.ajax({
                    url: params["url"],
                    type: params["type"],
                    dataType: params["dataType"],
                    data: params["data"],
                    cache: false,
                    timeout: 1e4,
                    beforeSend: function() {
                        app.showLoad();
                    },
                    success: function(result) {
                        var success = params["success"];
                        typeof success == "function" ? success(result) : "";
                    },
                    complete: function(msg, status) {
                        // console.log(msg.response);
                        app.hideLoad();
                        if (status == "timeout") {
                            //超时,status还有success,error等值的情况                       　　　　　
                            ajaxTimeoutTest.abort();
                            app.alert("由于网络原因，请求超时，请刷新网页试试");
                            app.saveLog("由于网络原因，请求超时，请刷新网页试试");
                        }
                        if (params["cache"]) {
                            var key = app.base64_encode(params["url"]);
                            var result = msg.response;
                            app.params.urlCache[key] = result;
                            app.cache().set(key, result);
                        }
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                        app.saveLog(errorThrown);
                        console.log(errorThrown);
                    }
                });
            },
            //保存错误日志
            saveLog: function(msg) {
                console.log(msg);
            },
            //轮播图
            swiper: function(id) {
                app.loadCss("plug/Swiper-4.4.2/css/swiper.min.css");
                app.getScript("plug/Swiper-4.4.2/js/swiper.min.js", function() {
                    var swiper = new window.Swiper("#" + id, {
                        pagination: "#" + id + " .swiper-pagination",
                        //nextButton: '#swiper_<{$data.name}> .swiper-button-next',
                        //prevButton: '#swiper_<{$data.name}> .swiper-button-prev',
                        loop: true,
                        spaceBetween: 30,
                        centeredSlides: true,
                        autoplay: 5e3
                    });
                }, false);
            },
            //页面切换
            swiperPage: function(id, callblack) {
                //  app.loadCss("plug/Swiper-3.3.1/swiper.css");
                app.getScript("plug/Swiper-3.3.1/swiper-3.4.1.jquery.min.js", function() {
                    //绑定滚动事件,记住滚动位置
                    // var swiperH=$(id).attr("swiperH");
                    // var swiperT=$(id).attr("swiperT");
                    var pageContent = $(id).parents(".page-content");
                    var swiperWrap = $(id + "-container");
                    $(swiperWrap).find(".swiperTap").find(".active").addClass("scrollActive");
                    $(pageContent).scroll(function(event) {
                        var swiperIndex = $(swiperWrap).find(".swiperTap").find(".scrollActive");
                        var scrollTop = $(this).scrollTop();
                        var scroll = $(swiperIndex).attr("scroll");
                        if (scroll != "0") {
                            $(swiperIndex).attr("scrollTop", scrollTop);
                        }
                    });
                    var swiper = new window.Swiper(id, {
                        pareanContainer: id + "-container",
                        //autoHeight:true,
                        onTransitionStart: function(swiper) {
                            var pageContent = $(id).parents(".page-content");
                            $(pageContent).addClass("overflowhidden");
                            $(swiperWrap).find(".swiperTap li").attr("scroll", "0");
                        },
                        onTransitionEnd: function(swiper) {
                            var activeIndex = swiper.activeIndex;
                            var swiperWrap = $(id + "-container");
                            $(swiperWrap).find(".swiperTap li").removeClass("scrollActive");
                            $(swiperWrap).find(".swiperTap").find("li").eq(activeIndex).addClass("scrollActive");
                            $(swiperWrap).find(".swiperTap li").attr("scroll", "1");
                            $(pageContent).removeClass("overflowhidden");
                        },
                        onSlideChangeEnd: function(swiper) {
                            var activeIndex = swiper.activeIndex;
                            var swiperWrap = $(id + "-container");
                            var scrollTop = $(swiperWrap).find(".swiperTap li").eq(activeIndex).attr("scrollTop");
                            $(id).parents(".page-content").scrollTop(scrollTop);
                            $(pageContent).removeClass("overflowhidden");
                        },
                        onSlideChangeStart: function(swiper) {
                            var activeIndex = swiper.activeIndex;
                            var slideActive = $(id).find(".swiper-slide").eq(activeIndex);
                            $(id).find(".swiper-slide").addClass("swiper-slide-hide");
                            slideActive.removeClass("swiper-slide-hide");
                            var load = slideActive.attr("load");
                            var name = slideActive.attr("name");
                            if (load != 1 && name) {
                                app.routePage(name, slideActive, 1);
                                slideActive.attr("load", 1);
                            }
                            var swiperWrap = $(id + "-container");
                            $(swiperWrap).find(".swiperTap li").removeClass("active");
                            $(swiperWrap).find(".swiperTap li").eq(activeIndex).addClass("active");
                            //alert(callblack);
                            //滚动到原来位置
                            // alert($(slideActive).height());
                            //$(id).height(($(slideActive).height()));
                            callblack ? callblack(swiper) : "";
                        },
                        onTouchMove: function(swiper, e) {
                            var activeIndex = swiper.activeIndex;
                            var container = $(id + "-container");
                            var transform = $(container).find(".swiper-wrapper").css("transform");
                            var w = swiper.width;
                            var li_w = $(container).find(".swiperTap li").eq(activeIndex).width();
                            if (typeof transform == "string" && transform && transform.indexOf("translate3d(") == "0") {
                                if (transform.indexOf("translate3d(") == "0") {
                                    var transforms = transform.substring(13).split(",");
                                    var transformsW = Number(transforms[0].replace(/px/g, ""));
                                    var transform_x = (transformsW - activeIndex * w) / w * li_w;
                                }
                            } else {
                                return false;
                            }
                            $(container).parents(".page").find(".nav-tab-fix li").eq(activeIndex).find(".swiperTapLine").css("left", transform_x + "px");
                            if ($(container).parents(".page").find(".nav-tab-fix li").length) {
                                $(container).find(".swiperTap li").eq(activeIndex).find(".swiperTapLine").css("left", transform_x + "px");
                            }
                        },
                        onTouchEnd: function(swiper, e) {
                            var container = $(id + "-container");
                            var activeIndex = swiper.activeIndex;
                            $(container).find(".swiperTap li").find(".swiperTapLine").css("left", "0px");
                            if ($(container).parents(".page").find(".nav-tab-fix li").length) {
                                $(container).parents(".page").find(".nav-tab-fix li").find(".swiperTapLine").css("left", "0px");
                            }
                        }
                    });
                    //绑定点击事件
                    var length = $(id).find(".swiper-slide").length;
                    $(id + "-container").find(".swiperTap li").click(function(event) {
                        var index = $(this).index();
                        if (length > index) {
                            swiper.slideTo(index);
                        }
                    });
                    if ($(id + "-container").parents(".page").find(".nav-tab-fix li").length) {
                        $(id + "-container").parents(".page").find(".nav-tab-fix li").click(function(event) {
                            var index = $(this).index();
                            if (length > index) {
                                swiper.slideTo(index);
                            }
                        });
                    }
                }, false);
            },
            /*
             * Javascript base64_encode() base64加密函数
             用于生成字符串对应的base64加密字符串
             * 吴先成  www.51-n.com ohcc@163.com QQ:229256237
             * @param string str 原始字符串
             * @return string 加密后的base64字符串
             */
            base64_encode: function(str) {
                var c1, c2, c3;
                var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
                var i = 0, len = str.length, string = "";
                while (i < len) {
                    c1 = str.charCodeAt(i++) & 255;
                    if (i == len) {
                        string += base64EncodeChars.charAt(c1 >> 2);
                        string += base64EncodeChars.charAt((c1 & 3) << 4);
                        string += "==";
                        break;
                    }
                    c2 = str.charCodeAt(i++);
                    if (i == len) {
                        string += base64EncodeChars.charAt(c1 >> 2);
                        string += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
                        string += base64EncodeChars.charAt((c2 & 15) << 2);
                        string += "=";
                        break;
                    }
                    c3 = str.charCodeAt(i++);
                    string += base64EncodeChars.charAt(c1 >> 2);
                    string += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
                    string += base64EncodeChars.charAt((c2 & 15) << 2 | (c3 & 192) >> 6);
                    string += base64EncodeChars.charAt(c3 & 63);
                }
                return string;
            },
            /*
             * Javascript base64_decode() base64解密函数
             用于解密base64加密的字符串
             * 吴先成  www.51-n.com ohcc@163.com QQ:229256237
             * @param string str base64加密字符串
             * @return string 解密后的字符串
             */
            base64_decode: function(str) {
                var c1, c2, c3, c4;
                var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
                var i = 0, len = str.length, string = "";
                while (i < len) {
                    do {
                        c1 = base64DecodeChars[str.charCodeAt(i++) & 255];
                    } while (i < len && c1 == -1);
                    if (c1 == -1) break;
                    do {
                        c2 = base64DecodeChars[str.charCodeAt(i++) & 255];
                    } while (i < len && c2 == -1);
                    if (c2 == -1) break;
                    string += String.fromCharCode(c1 << 2 | (c2 & 48) >> 4);
                    do {
                        c3 = str.charCodeAt(i++) & 255;
                        if (c3 == 61) return string;
                        c3 = base64DecodeChars[c3];
                    } while (i < len && c3 == -1);
                    if (c3 == -1) break;
                    string += String.fromCharCode((c2 & 15) << 4 | (c3 & 60) >> 2);
                    do {
                        c4 = str.charCodeAt(i++) & 255;
                        if (c4 == 61) return string;
                        c4 = base64DecodeChars[c4];
                    } while (i < len && c4 == -1);
                    if (c4 == -1) break;
                    string += String.fromCharCode((c3 & 3) << 6 | c4);
                }
                return string;
            },
            //缓存
            cache: function(v) {
                var versions = v ? v : app.getVersions();
                var cacheFun = {
                    set: function(key, data) {
                        var value;
                        key = key + "_" + versions;
                        if (typeof data == "object") {
                            data = JSON.stringify(data);
                            value = "obj-" + data;
                        } else {
                            value = "str-" + data;
                        }
                        try {
                            localStorage.setItem(key, value);
                        } catch (err) {
                            if (err.name == "QuotaExceededError") {
                                localStorage.clear();
                                //如果缓存已满则清空
                                localStorage.setItem(key, value);
                            }
                        }
                    },
                    rm: function(key) {
                        key = key + "_" + versions;
                        localStorage.removeItem(key);
                    },
                    get: function(key) {
                        key = key + "_" + versions;
                        var value = localStorage.getItem(key);
                        if (value == null) {
                            return null;
                        }
                        var type = value.substr(0, 4);
                        if (type == "str-") {
                            return value.substr(4);
                        }
                        if (type == "obj-") {
                            var data = value.substr(4);
                            return $.parseJSON(data);
                        }
                    },
                    clear: function() {
                        localStorage.clear();
                    }
                };
                return cacheFun;
            },
            //微信默认分享
            wxDefShare: function(params) {
                if (typeof params == "undefined") {
                    var wxShareData = {
                        title: "跟着普象君有肉吃",
                        // 分享标题
                        imgUrl: "https://www.lgstatic.com/thumbnail_300x300/image1/M00/00/47/Cgo8PFTUXOOAbTbtAAA-0t30W6k220.jpg",
                        // 分享图标
                        desc: "等你好久了，终于来了"
                    };
                } else {
                    wxShareData = params;
                }
                app.wxShare(wxShareData);
            },
            // get vue vm
            getVm: function(name) {
                if (typeof name == "string") {
                    name = "js/" + name;
                    return seajs.Module.get(require.resolve(name)) && seajs.Module.get(require.resolve(name)).exports && seajs.Module.get(require.resolve(name)).exports.vm;
                } else {
                    return null;
                }
            },
            setPageData: function(pageName, data) {
                var curData = this.pageData[pageName] ? this.pageData[pageName] : {};
                // console.log("setPageData",data);
                for (var i in data) {
                    //console.log("i", i, data[i]);
                    curData[i] = data[i];
                }
                this.pageData[pageName] = curData;
            },
            getPageData: function(pageName, key) {
                var curData = this.pageData[pageName];
                if (key) {
                    return curData ? curData[key] : null;
                } else {
                    return curData;
                }
            },
            area: function(_this) {
                app.getScript("plug/area.js", function() {
                    $(_this).attr("domain", app.params.apiDomain);
                    $(_this).area();
                });
            },
            areaForbank: function(_this) {
                app.getScript("plug/areaForbank.js", function() {
                    $(_this).attr("domain", app.params.apiDomain);
                    $(_this).area();
                });
            },
            // 绑手机
            bindPhone: function() {
                // var params = app.GetRequest(window.location.search);
                var url = window.location.href;
                app.component("bindphone", {
                    title: "绑定手机号",
                    success: function(res) {
                        window.location.href = url;
                    }
                });
            },
            pay: function(order_sn, type) {
                var payurl = app.params.apiDomain + "apiv2/pay/run/?order_sn=" + order_sn;
                if (type) {
                    payurl += "&paytype=" + type;
                }
                var url = window.location.href;
                var Request = app.GetRequest(url);
                // 微信小程序
                if (Request.from_wx_app == "miniprogram") {
                    app.wxJs(function(wx) {
                        wx.miniProgram.redirectTo({
                            url: "/pages/pay/index?order_sn=" + order_sn
                        });
                    });
                    return;
                }
                // 去支付 
                if (url.indexOf("/apps/?") > 0) {
                    app.showLoad();
                    if ($("#payBoxHide").length == 0) {
                        $("body").append('<div style="display:none" id="payBoxHide"></div>');
                    }
                    $("#payBoxHide").load(payurl, function() {
                        app.hideLoad();
                    });
                } else {
                    window.location.href = payurl;
                }
            }
        };
        $.extend(true, app, fun);
        return app;
    };
    module.exports = app;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function (params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },

                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    bill_amount: "0.00",
                    shop_id: 0,
                    shop_info: {},
                    provider_shop_id: 0,
                    nodata: 0
                };
            },
            el: "#pageAccount",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();
                this.getBillList();
            },

            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
            },
            methods: {
                // getShopInfo:function(){
                //     var that = this;
                //     app.get("/mall/shop/find",{

                //     },function(res){
                //          if(res.code==200){
                //              that.shop_info = res.data;
                //          }

                //     });
                // },

                getBillList: function getBillList() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    app.get("/mall/shop_bills/get", {
                        // shop_id:this.shop_id,
                        status: 0
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.bills_list = res.data.list;
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                },
                countPrice: function countPrice() {
                    var bill_amount = 0;
                    $("[name='checkbox1']:checked").each(function (i, checkbox) {
                        bill_amount += Number($(checkbox).attr("data-bill_entry_amount"));
                    });
                    this.bill_amount = bill_amount;
                },
                selectAll: function selectAll() {
                    if ($("[name='checkbox2']").prop("checked")) {
                        $("[name='checkbox1']").prop("checked", true);
                    } else {
                        $("[name='checkbox1']").prop("checked", false);
                    }

                    this.countPrice();
                },
                postOrder: function postOrder() {
                    var bill_entry_ids = [];
                    $("[name='checkbox1']:checked").each(function (i, checkbox) {
                        bill_entry_ids.push($(checkbox).attr("data-bill_entry_id"));
                    });
                    if (bill_entry_ids.length === 0) {
                        return;
                    }
                    app.post("/api/pay/shop_bills_order", {
                        bill_entry_id: bill_entry_ids.join(",")
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.pay(res.data.order_sn);
                    });
                    // console.log(bill_entry_ids);
                },

                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }

            }
        }).$mount("#app");
    };
    controller.pageShow = function () {};
    module.exports = controller;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    editData: {}
                };
            },
            el: '#pageAddBook',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {

                if (this.mounted == 1) {
                    return;
                }

                this.mounted = 1;
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.shop_id = this.$route.params.shop_id;
                    this.id = this.$route.params.id;
                    if (this.id) {
                        this.getData();
                    }
                },
                getData: function getData() {
                    var that = this;
                    that.loading = 1;

                    app.get("mall/dining_table/find", {
                        shop_id: this.shop_id,

                        id: this.id
                    }, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.editData = res.data;
                    });
                },

                saveBook: function saveBook(id) {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    var post = {};
                    $("#formNewBook").find("input").each(function (i, input) {
                        post[$(input).attr('name')] = $(input).val();
                    });

                    app.post("mall/dining_table/add", post, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert('保存成功');
                        app.setPageData("index", { reload: 0 });
                        that.$router.go(-1);
                    });
                },
                cancel: function cancel() {
                    this.$router.go(-1);
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    bankInfo: {},
                    showType: 1,
                    bankList: [],

                    bankSubbranchList: [],
                    contactline: '',
                    MerchantName: '',
                    MerchantId: '',
                    Fee: 0
                };
            },
            el: '#pageBankInfo',
            created: function created() {
                this.fetchData();
                app.area(".bankArea");
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.getBank();
                    this.getBankInfo();
                },
                getBankInfo: function getBankInfo() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    that.loading = 1;

                    var user_info = app.getUserInfo();

                    app.get("apiv2/mch_my_bank/merchantInfo", {}, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.bankInfo = res.data.BankCardParam;
                        // that.MerchantDetail = res.data.MerchantDetail;
                        that.MerchantName = res.data.MerchantName;
                        that.MerchantId = res.data.MerchantId;
                        that.Fee = res.data.FeeParamList[0].FeeValue * 100 + "%";
                    });
                },
                getBank: function getBank() {
                    var that = this;
                    app.get("apiv2/bank/getBank", {}, function (res) {

                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.bankList = res.data;
                    });
                },
                getBankSubbranch: function getBankSubbranch() {
                    var that = this;
                    var data = {};

                    data.bankId = $("[name='BankName']").val();
                    // data.city_name=$("#bankCity").find("option:selected").text();
                    data.city_name = $("#bankCity option:selected").text();
                    if (!data.city_name) {
                        return;
                    }
                    app.get("apiv2/bank/getBankSubbranch", data, function (res) {

                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.bankSubbranchList = res.data;
                    });
                },
                setContactLine: function setContactLine() {
                    var value = $("[name='BranchName']").val();
                    this.contactline = $("[name='BranchName']").find("[value='" + value + "']").attr("contactline");
                },
                saveBankInfo: function saveBankInfo() {
                    var that = this;
                    var data = $("#bankInfoForm").serializeArray();
                    data.push({
                        name: "method",
                        value: 'updateMerchantBankCard'
                    });
                    app.post("/apiv2/mch_my_bank", data, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert("修改成功");
                        that.getBankInfo();
                        that.showType = 1;
                    });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function (params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },

                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    nodata: 0,
                    shop_id: 0,
                    shop_info: {},
                    bill_amount: "0.00"
                };
            },
            el: "#pageBillsRecords",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();

                this.getBillList();
            },

            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                var that = this;
                app.pager("#pageBillsRecords", function () {
                    that.getBillList();
                });
                this.mounted = 1;
            },
            methods: {
                getShopInfo: function getShopInfo() {
                    var that = this;
                    app.get("/mall/shop/find", {}, function (res) {
                        if (res.code == 200) {
                            that.shop_info = res.data;
                        }
                    });
                },
                getRoomInfo: function getRoomInfo() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    app.get("/api/community_rooms/find", {
                        out_room_id: out_room_id
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.room_info = res.data;
                    });
                },
                getBillList: function getBillList() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    var page = this.page;
                    if (that.lastPage == 1 || this.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    app.get("/mall/shop_bills/get", {
                        // shop_id:this.shop_id,
                        page: page,
                        limit: 20,
                        status: 1
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        // that.bills_list = res.data.list;
                        if (res.data.list.length === 0) {
                            that.lastPage = 1;
                        }

                        page++;
                        if (res.data.list.length > 0) {
                            that.setData({ page: page, loading: 0, 'bills_list': that.bills_list.concat(res.data.list) });
                        }
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                },
                countPrice: function countPrice() {
                    var bill_amount = 0;
                    $("[name='checkbox1']:checked").each(function (i, checkbox) {
                        bill_amount += Number($(checkbox).attr("data-bill_entry_amount"));
                    });
                    this.bill_amount = bill_amount;
                },
                selectAll: function selectAll() {
                    if ($("[name='checkbox2']").prop("checked")) {
                        $("[name='checkbox1']").prop("checked", true);
                    } else {
                        $("[name='checkbox1']").prop("checked", false);
                    }

                    this.countPrice();
                },
                postOrder: function postOrder() {
                    var bill_entry_ids = [];
                    $("[name='checkbox1']:checked").each(function (i, checkbox) {
                        bill_entry_ids.push($(checkbox).attr("data-bill_entry_id"));
                    });
                    if (bill_entry_ids.length === 0) {
                        return;
                    }
                    app.post("/api/pay/community_bills_order", {
                        bill_entry_id: bill_entry_ids.join(",")
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.pay(res.data.order_sn);
                    });
                    // console.log(bill_entry_ids);
                },

                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }

            }
        }).$mount("#app");
    };
    controller.pageShow = function () {};
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    show_qrcode_url: ''

                };
            },
            el: '#pageBindScanBox',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                // app.copy("#shareClipboard",function(res){
                //    console.log(res);
                //    if(res=="success"){
                //      app.alert("链接复制成功");
                //    }else{
                //      this.share();
                //    }
                // });
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    // this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var that = this;
                    app.get("/apiv2/pay_request/bindScanBox/", { shop_id: this.$route.params.shop_id }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }

                        that.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(res.data);
                    });
                },

                share: function share() {
                    var text = '复制链接发给朋友：' + this.url;
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    items: [],

                    type: 1
                };
            },
            el: '#pageBook',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {

                if (this.mounted == 1) {
                    return;
                }

                this.mounted = 1;
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.shop_id = this.$route.params.shop_id;

                    this.getList();
                },
                getList: function getList() {
                    var that = this;
                    that.loading = 1;

                    app.get("mall/dining_table/get", {
                        shop_id: this.shop_id,
                        order: 'id desc'
                    }, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.items = res.data.list;
                    });
                },
                preview: function preview() {
                    var user_info = app.getUserInfo();
                    var url = "/pages/book/?store_id=" + user_info.store_id + "#/";
                    window.location.href = url;
                },
                pageShow: function pageShow() {
                    var reload = app.getPageData("index", 'reload');
                    // console.log(reload);
                    if (reload) {
                        app.setPageData("index", { reload: 0 });
                        this.getList();
                    }
                },
                delBook: function delBook(id) {
                    var that = this;
                    app.confirm({
                        'text': '确认删除吗？',
                        'yes': function yes() {
                            app.get("mall/dining_table/del", { id: id, shop_id: this.shop_id }, function (res) {
                                if (res.code != 200) {
                                    app.alert(res.msg);
                                    return;
                                }
                                that.getList();
                            });
                        }
                    });
                },
                shareUrl: function shareUrl() {
                    var store_id = app.getStoreId();
                    var url = "/apps/?app=book&store_id=" + store_id + "#/";
                    var shareUrl = encodeURIComponent("https://wap.bestsmartbee.com" + url);
                    this.$router.push({ name: "shareUrl", params: { url: shareUrl } });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    goods: [],
                    ids: {},
                    tags: []
                };
            },
            el: '#pageChooseGoods',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.shop_id = this.$route.params.shop_id;
                    this.id = this.$route.params.id;
                    this.loadids();
                    this.getTags();
                },
                loadids: function loadids() {
                    var that = this;
                    that.goods = [];
                    var params = {
                        shop_id: this.shop_id,
                        limit: 100,
                        attr_id: this.id,
                        status: 1,
                        fields: 'goods_name,attr_id,id,default_img'
                    };

                    app.get("mall/goods/get", params, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        var ids = {};
                        for (var i in res.data.list) {
                            ids[res.data.list[i].id] = res.data.list[i].id;
                        }
                        that.ids = ids;
                        that.loadGoods();
                    });
                },

                loadGoods: function loadGoods() {
                    var that = this;
                    that.goods = [];
                    var params = {
                        shop_id: this.shop_id,
                        limit: 100,
                        fields: 'goods_name,attr_id,id,default_img'
                    };
                    if (this.attr_id) {
                        params.attr_id = this.attr_id;
                    }
                    if (this.kw) {
                        params.kw = this.kw;
                    }
                    app.get("mall/goods/get", params, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        var goods = [];
                        var good = {};
                        for (var i in res.data.list) {
                            good = res.data.list[i];
                            if (that.ids[good.id]) {
                                good.choose = 1;
                            }
                            goods.push(good);
                        }
                        that.goods = goods;
                    });
                },
                tag: function tag(e, goods_id) {

                    if ($(e.target).prop("checked")) {
                        this.addTag(goods_id);
                    } else {
                        this.delTag(goods_id);
                    }
                },

                delTag: function delTag(goods_id) {

                    var that = this;
                    app.get("mall/goods/delTag", {
                        goods_id: goods_id,
                        shop_id: this.shop_id,
                        attr_id: this.id
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.ids[goods_id] = 0;
                        app.setPageData("index", { reload: 1 });
                    });
                },

                addTag: function addTag(goods_id) {

                    var that = this;
                    app.get("mall/goods/addTag", {
                        goods_id: goods_id,
                        shop_id: this.shop_id,
                        attr_id: this.id
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.ids[goods_id] = goods_id;
                        app.setPageData("index", { reload: 1 });
                    });
                },
                getTags: function getTags() {
                    var that = this;
                    app.get("mall/tag/get", {
                        shop_id: this.shop_id
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.tags = res.data.list;
                        Vue.nextTick(function () {
                            that.select();
                        });
                    });
                },
                select: function select() {
                    var that = this;
                    var $eventSelect = $("#pageChooseGoods #tag_name");
                    $eventSelect.select2({
                        placeholder: '请选择分类名称或商品名称',
                        allowClear: false,
                        tags: true

                    });
                    $eventSelect.on("select2:select", function (e) {
                        var data = $(this).select2("data")[0];
                        if (Number(data.id) > 0) {
                            that.attr_id = data.id;
                            that.kw = '';
                        } else {
                            that.attr_id = 0;
                            that.kw = data.id;
                        }
                        console.log(data);
                        that.loadGoods();
                    });
                }

            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
  var router = require("router");
  //var app = require("app");
  var controller = {};
  var goodslist = {};
  var goods_spec = {};
  controller.vue = function () {
    controller.vm = new Vue({
      router: router,
      data: function data() {
        return {
          shop_info: {},
          shoppingCartList: [],
          goods: {},
          tabid: -1,
          popup: 0,
          popup2: 0,
          data: {},
          choose_property_data: {},
          choose_spec: {},
          disabled: 0,
          spec_keys_str: '',
          goods_in_cart: {},
          tag_list: []
        };
      },
      el: '#pageGoods',
      created: function created() {
        this.fetchData();
      },

      methods: {
        fetchData: function fetchData() {
          var that = this;
          this.shop_id = this.$route.params.shop_id;
          var user_info = app.getUserInfo();
          if (this.shop_id > 0) {
            this.getShopInfo();
            this.getTagList();
          } else {

            app.component("get_shop_id", {
              success: function success(shop_id) {
                that.shop_id = shop_id;
                that.$router.push({ name: "goods", params: { shop_id: shop_id } });
              }
            });
          }
        },
        setData: function setData(arr) {
          for (var i in arr) {
            // console.log(i);
            // console.log(arr[i]);
            // this.$set(i,arr[i]); 
            this[i] = arr[i];
          }
        },
        // 商铺信息
        getShopInfo: function getShopInfo() {
          var that = this;
          app.get("mall/shop/find", { shop_id: this.shop_id }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
            } else if (res.data) {
              that.shop_info = res.data;
            }
          });
        },

        // 标签列表
        getTagList: function getTagList() {
          var that = this;
          app.get("mall/tag/get", { shop_id: this.shop_id }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
            } else if (res.data) {
              that.tag_list = res.data.list;
              that.showTabs(0);
            }
          });
        },

        //商品列表
        loadList: function loadList(reload) {
          var that = this;
          var attr_id = this.attr_id;
          if (that.goods[attr_id] && that.goods[attr_id].length > 0) {
            return;
          }
          app.get("mall/goods/get", {
            attr_id: this.attr_id
            // status:1
          }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
            }

            if (res.data && res.data.list) {
              goodslist[attr_id] = res.data.list;
            } else {
              goodslist[attr_id] = [];
            }
            var that_goods = that.goods;
            var goods = [];
            for (var k in goodslist[attr_id]) {
              var item = goodslist[attr_id][k];
              goods.push({
                default_img: item['default_img'],
                goods_name: item['goods_name'],
                origin_price: item['origin_price'],
                price: item['price'],
                total_stock: item['total_stock'],
                sub_title: item['sub_title'],
                id: item['id'],
                status: item['status']
              });
            }
            that.goods = {};
            that_goods[attr_id] = goods;
            that.goods = that_goods;
            // console.log(that.goods);
          });
        },
        showTabs: function showTabs(index) {

          if (this.tabid == index) {
            return;
          }

          var tag = this.tag_list[index];
          // console.log(tag);
          this.attr_id = tag.id;
          this.setData({ tabid: index });
          this.loadList();
        },
        deleteRowMallGoods: function deleteRowMallGoods(attr_id, idx2, id) {
          // console.log(idx2);
          var that = this;
          var goods = this.goods;
          app.get('/mall-admin/mall-goods/delete', {
            shop_id: this.shop_id,
            ids: id
          }, function (data) {
            if (data.error === 0) {
              var status = goods[attr_id][idx2].status;
              goods[attr_id][idx2].status = status == 1 ? 2 : 1;
              // console.log(status);
              //  console.log(goods);
              that.goods = [];
              that.goods = goods;
            } else {
              app.alert(data.msg);
            }
          });
        },
        editGoods: function editGoods(id) {
          var user_info = app.getUserInfo();
          var url = 'https://www.bestsmartbee.com/mall-admin/mall-goods/add?id=' + id + "&token=" + user_info.token + "&shop_id=" + this.shop_id;
          // console.log(url);
          window.location.href = url;
        },
        newGoods: function newGoods(id) {
          var user_info = app.getUserInfo();
          var url = 'https://www.bestsmartbee.com/mall-admin/mall-goods/add?shop_id=' + this.shop_id + '&token=' + user_info.token;
          // console.log(url);
          window.location.href = url;
        }

      }

    }).$mount('#app');
  };
  module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    items: [],

                    type: 1
                };
            },
            el: '#pageIndex',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {

                if (this.mounted == 1) {
                    return;
                }

                this.mounted = 1;
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.shop_id = this.$route.params.shop_id;

                    this.type = this.$route.params.type;
                    if (this.type == 1) {
                        app.setTitle('外卖分类');
                    } else if (this.type == 2) {
                        app.setTitle('到店扫码点餐分类');
                    }
                    this.init();
                },
                getList: function getList() {
                    var that = this;
                    that.loading = 1;
                    console.log(that.$route.params);
                    app.get("mall/tag/getByType", {
                        shop_id: this.shop_id,
                        type: that.$route.params.type + ",12"
                    }, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.items = res.data;
                    });
                },
                preview: function preview() {
                    var url = "";
                    var store_id = app.getStoreId();
                    if (this.type == 1) {
                        url = "/apps/app=takeout&store_id=" + store_id + "#/" + this.shop_id;
                    } else {
                        url = "/apps/?app=eat_in_hall&store_id=" + store_id + "#/shop_id/" + this.shop_id;
                    }
                    window.location.href = url;
                },
                pageShow: function pageShow() {
                    var reload = app.getPageData("index", 'reload');
                    // console.log(reload);
                    if (reload) {
                        app.setPageData("index", { reload: 0 });
                        this.getList();
                    }
                    // var shop_id = app.getPageData("index",'shop_id');
                    // console.log(shop_id);
                    // if(shop_id>0){
                    //    app.setPageData("index",{shop_id:0});
                    //    this.shop_id = shop_id;
                    //    this.getList();
                    // }
                },
                init: function init() {
                    if (this.shop_id > 0) {
                        this.getList();
                    } else {
                        var that = this;
                        app.component("get_shop_id", {
                            success: function success(shop_id) {
                                that.shop_id = shop_id;
                                app.setPageData("index", { shop_id: shop_id });
                                // console.log("get_shop_id",shop_id);

                                // that.$router.go(-1);
                                that.$router.push({ name: "index", params: { shop_id: shop_id, type: that.type } });
                            }
                        });
                    }
                },
                eat_in_hall_pay_setting: function eat_in_hall_pay_setting() {
                    var user_info = app.getUserInfo();
                    var url = 'https://www.bestsmartbee.com/mall-admin/mall-promotion/add?from=webapp&from_wx_app=1&token=' + user_info.token + '&name=eat_in_hall_pay&shop_id=' + this.shop_id;
                    window.location.href = url;
                },

                freight_setting: function freight_setting() {
                    var user_info = app.getUserInfo();
                    var url = 'https://www.bestsmartbee.com/mall-admin/mall_promotion/index?from=webapp&from_wx_app=1&token=' + user_info.token + '&shop_id=' + this.shop_id;
                    window.location.href = url;
                },
                shareUrl: function shareUrl() {
                    var store_id = app.getStoreId();
                    var url = "";
                    if (this.type == 1) {
                        url = "/pages/takeout/?store_id=" + store_id + "#/" + this.shop_id;
                    } else {
                        url = "/pages/eat_in_hall/?store_id=" + store_id + "#/shop_id/" + this.shop_id;
                    }
                    var shareUrl = encodeURIComponent("https://wap.bestsmartbee.com" + url);
                    this.$router.push({ name: "shareUrl", params: { url: shareUrl } });
                }

            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require) {
    var PuthinkApp = require('app');
    //vue 组件
    // require('js/component');
    //zach
    //配置文件
    var params = {
        apiDomain: seajs.data.apiDomain ? seajs.data.apiDomain : 'https://www.bestsmartbee.com/', //接口域名 不带"/"
        domain: '', //网站域名  不带"/",
        appname: seajs.data.appname,
        debug: seajs.data.debug ? seajs.data.debug : false,
        versions: seajs.data.versions ? seajs.data.versions : '6.8',
        userVersions: seajs.data.userVersions ? seajs.data.userVersions : '6.9'
    };

    //app 实例之后 ， 只执行一次
    PuthinkApp.afterInit = function () {
        var _hmt = _hmt || [];
    };

    //页面显示时引用，每次都会执行
    PuthinkApp.pageShow = function (params) {
        var name = params.name;
        // console.log();
    };

    //实例化app
    window.app = new PuthinkApp(params);
    app.login(function () {
        app.init();
    });
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    merchantInfo: {},
                    MerchantName: '',
                    MerchantId: '',
                    showType: 1,
                    storeData: {},
                    logoString: []
                };
            },
            el: '#pageMerchantInfo',
            created: function created() {
                this.fetchData();
                // app.area(".DestinationArea");
                var _this = this;
                app.cityPicker("#DestinationArea", {
                    title: "选择地区",
                    onChange: function onChange(picker, values, displayValues) {
                        console.log(values);
                        //   console.log( displayValues);
                        _this.destinationAreaValues = values;
                        _this.destinationArea = displayValues;
                        $("#District").val(values[2]);
                        $("#City").val(values[1]);
                        $("#Province").val(values[0]);

                        // $("#county_name").val(displayValues[2]);
                        // $("#city_name").val(displayValues[1]);
                        // $("#province_name").val(displayValues[0]);


                        // that.cityName = displayValues[1];
                        // that.countyName = displayValues[2];
                    }
                });
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.getInfo();
                    this.getStoreData();
                },
                getInfo: function getInfo() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    that.loading = 1;

                    var user_info = app.getUserInfo();

                    app.get("apiv2/mch_my_bank/merchantInfo", {}, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.merchantInfo = res.data.MerchantDetail;
                        // that.MerchantDetail = res.data.MerchantDetail;
                        that.MerchantName = res.data.MerchantName;
                        that.MerchantId = res.data.MerchantId;
                    });
                },

                getStoreData: function getStoreData() {
                    var that = this;
                    that.loading = 1;

                    app.get("api/user/info", {
                        fields: 'store'
                    }, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.storeData = res.data.store;
                        if (that.storeData.logo) {
                            that.logoString = JSON.stringify([{ name: 'logo', file_url: that.storeData.logo }]);
                        }
                        that.$nextTick(function () {
                            app.upload($("#storeLogo"));
                        });
                    });
                },

                saveStore: function saveStore() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    var post = {
                        logo: $('[name="logo"]').val(),
                        store_id: $('[name="store_id"]').val(),
                        store_name: $('[name="Alias"]').val(),
                        phone: $('[name="ContactMobile"]').val(),
                        address: $('[name="DestinationArea"]').val() + $('[name="Address"]').val()
                    };
                    // $("#formNewBook").find("input").each(function(i,input){
                    //    post[$(input).attr('name')] = $(input).val();
                    // });

                    app.post("apiv2/store/save", post, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                    });
                },

                updateMerchantInfo: function updateMerchantInfo() {
                    this.saveStore();
                    var that = this;
                    var data = $("#InfoForm").serializeArray();
                    data.push({
                        name: "method",
                        value: 'updateMerchantInfo'
                    });
                    app.post("/apiv2/mch_my_bank", data, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert("修改成功");
                        that.getInfo();
                        that.showType = 1;
                    });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
  var router = require("router");
  //var app = require("app");
  var controller = {};
  controller.vue = function () {
    controller.vm = new Vue({
      router: router,
      data: function data() {
        return {
          shop_id: 0,
          type: 1,
          id: 0,
          editData: {},
          tags: [],
          goods: [],
          tag_name: ''
        };
      },
      el: '#pageNewCate',
      created: function created() {
        this.fetchData();
      },
      mounted: function mounted() {

        if (this.mounted == 1) {
          return;
        }

        this.mounted = 1;
      },

      methods: {
        fetchData: function fetchData() {
          var _this = this;
          this.shop_id = this.$route.params.shop_id;

          this.type = this.$route.params.type;
          this.id = this.$route.params.id;
          if (this.id > 0) {
            this.initTag();
            // this.loadGoods();
          } else {
            this.getTags();
          }
        },
        select: function select() {
          var that = this;
          var $eventSelect = $("#pageNewCate #tag_name");
          $eventSelect.select2({
            placeholder: '请输入分类名称',
            allowClear: false,
            tags: true

          });
          $eventSelect.on("select2:select", function (e) {
            var data = $(this).select2("data")[0];
            if (Number(data.id) > 0) {
              that.id = data.id;
            }
            that.saveTagName(data.text);
          });
        },
        saveTagByInput: function saveTagByInput() {
          this.tag_name = $("#tag_name").val();
          this.saveTagName(this.tag_name);
        },
        saveTagName: function saveTagName(name) {
          var that = this;
          app.post("mall/tag/add", {
            name: name,
            type: this.type,
            id: this.id,
            order_by: $("#order_by").val() ? $("#order_by").val() : 999,
            shop_id: this.shop_id
          }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
              return;
            }
            // if(that.id != res.data.id){
            //   that.loadGoods();
            //   that.id = res.data.id;
            // }
            that.loadGoods();
            that.id = res.data.id;
            that.editData = res.data;
            app.setPageData("index", { reload: 1 });
            $(".select2").remove();
            // console.log( that.id);

          });
        },
        getTags: function getTags() {
          var that = this;
          app.get("mall/tag/get", {
            shop_id: this.shop_id
          }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
              return;
            }
            that.tags = res.data.list;
            Vue.nextTick(function () {
              that.select();
            });
          });
        },
        initTag: function initTag() {
          var that = this;
          app.get("mall/tag/find", {
            id: this.id
          }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
              return;
            }
            that.editData = res.data;
            // that.tag_name = res.data.name;
          });
        },
        loadGoods: function loadGoods() {
          var that = this;
          that.goods = [];
          app.get("mall/goods/get", {
            attr_id: this.id,
            shop_id: this.shop_id,
            status: 1,
            limit: 100
          }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
              return;
            }
            that.goods = res.data.list;
          });
        },
        showAct: function showAct(goods_id, index) {

          var that = this;

          var params = [{
            'text': '删除',
            'methods': function methods() {
              app.colseHandle();
              that.delete(goods_id, index);
            }
          }];
          app.handle(params);

          // _this.$router.push({ name: 'addMemberCard', params: { id: _this.cardInfo. } });
          // { name: 'addMemberCard', params: { id: cardInfo.id ,appid:0 }}
        },
        delTag: function delTag() {
          var that = this;
          var goods = this.goods;
          app.confirm({
            text: '确认删除些分类吗？',
            yes: function yes() {
              app.get("mall/tag/del", {
                id: that.id
              }, function (res) {
                if (res.code != 200) {
                  app.alert(res.msg);
                  return;
                }
                app.setPageData("index", { reload: 1 });
                that.$router.go(-1);
              });
            }
          });
        },
        delete: function _delete(goods_id, index) {

          var that = this;
          var goods = this.goods;

          app.get("mall/goods/delTag", {
            goods_id: goods_id,
            shop_id: this.shop_id,
            attr_id: this.id
          }, function (res) {
            if (res.code != 200) {
              app.alert(res.msg);
              return;
            }
            app.setPageData("index", { reload: 1 });
            goods.splice(index, 1);
          });
        },
        pageShow: function pageShow() {
          // console.log('pageShow');
          this.loadGoods();
        }

      }

    }).$mount('#app');
  };
  module.exports = controller;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function (params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },

                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    nodata: 0,
                    shop_id: 0,
                    status: '',
                    shop_info: {},
                    bill_amount: "0.00"
                };
            },
            el: "#pageProviderShopbill",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();

                this.getBillList();
            },

            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                var that = this;
                app.pager("#pageBillsRecords", function () {
                    that.getBillList();
                });
                this.mounted = 1;
            },
            methods: {

                setStatus: function setStatus(status) {
                    // this.bills_list=[];
                    this.status = status;
                    this.getBillList(1);
                },

                getBillList: function getBillList() {
                    var reload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

                    if (reload == 1) {
                        this.setData({ page: 1, loading: 0, bills_list: [], lastPage: 0, nodata: 0 });
                    }
                    var that = this;
                    var page = this.page;
                    if (that.lastPage == 1 || this.loading == 1) {
                        return;
                    }
                    var params = {

                        page: page,
                        limit: 20
                    };
                    if (this.status !== "") {
                        params.status = this.status;
                    }
                    this.loading = 1;
                    app.get("/mall/shop_bills/get", params, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        // that.bills_list = res.data.list;
                        if (res.data.list.length === 0) {
                            that.lastPage = 1;
                        }

                        page++;
                        if (res.data.list.length > 0) {
                            that.setData({ page: page, loading: 0, 'bills_list': that.bills_list.concat(res.data.list) });
                        }
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        } else {
                            that.nodata = 0;
                        }
                    });
                },

                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }

            }
        }).$mount("#app");
    };
    controller.pageShow = function () {};
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var Router = new VueRouter({
        routes: [{
            path: '/:shop_id/:type',
            name: 'index',
            title: ''
        }, {
            path: '/newCate/:shop_id/:type/:id',
            name: 'newCate',
            title: '编辑分类'
        }, {
            path: '/chooseGoods/:shop_id/:id',
            name: 'chooseGoods',
            title: '选择商品'
        }, {
            path: '/shopQCode/shop_id/:shop_id',
            name: 'shopQCode',
            title: '门店名片'
        }, {
            path: '/goods/list/:shop_id',
            name: 'goods',
            title: '商品库'
        }, {
            path: '/bankInfo',
            name: 'bankInfo',
            title: '银行卡信息'
        }, {
            path: '/merchantInfo',
            name: 'merchantInfo',
            title: '商户信息'
        }, {
            path: '/book/list/:shop_id',
            name: 'book',
            title: '预约设置'
        }, {
            path: '/book/add/:shop_id/:id',
            name: 'addBook',
            title: '预约设置'
        }, {
            path: '/store/update/:store_id',
            name: 'updateStore',
            title: '商户信息'
        }, {
            path: '/shopbill/shop_id/:shop_id',
            name: 'shopbill',
            title: '佣金账单'
        }, {
            path: '/providerShopbill/shop_id/:shop_id',
            name: 'providerShopbill',
            title: '佣金账单'
        }, {
            path: '/billsRecords/shop_id/:shop_id',
            name: 'billsRecords',
            title: '历史账单'
        }, {
            path: '/stmtPayResultQuery',
            name: 'stmtPayResultQuery',
            title: '结算打款记录'
        }, {
            path: '/shareUrl/url/:url',
            name: 'shareUrl',
            title: '分享链接'
        }, {
            path: '/bindScanBox/shop_id/:shop_id',
            name: 'bindScanBox',
            title: '绑定支付盒子'
        }]
    });
    module.exports = Router;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    downUrl: ''

                };
            },
            el: '#pageShopQCode',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                app.copy("#shareClipboard", function (res) {
                    console.log(res);
                    if (res == "success") {
                        app.alert("链接复制成功");
                    } else {
                        this.share();
                    }
                });
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var user_info = app.getUserInfo();
                    this.url = app.params.apiDomain + '/mall/pages/renderPage?shop_id=' + this.$route.params.shop_id + '&page=pages%2Findex%2Findex';
                    this.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(this.url);
                },

                share: function share() {
                    var text = '复制链接发给朋友：' + this.url;
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    downUrl: ''

                };
            },
            el: '#pageShareUrl',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                app.copy("#shareClipboard", function (res) {
                    console.log(res);
                    if (res == "success") {
                        app.alert("链接复制成功");
                    } else {
                        this.share();
                    }
                });
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    // this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var user_info = app.getUserInfo();
                    this.url = decodeURIComponent(this.$route.params.url);
                    this.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(this.url);
                },

                share: function share() {
                    var text = '复制链接发给朋友：' + decodeURIComponent(this.url);
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                }

            }

        }).$mount('#app');
    };
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    downUrl: ''

                };
            },
            el: '#pageShopQCode',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                app.copy("#shareClipboard", function (res) {
                    console.log(res);
                    if (res == "success") {
                        app.alert("链接复制成功");
                    } else {
                        this.share();
                    }
                });
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var user_info = app.getUserInfo();

                    this.url = app.params.apiDomain + '/mall/pages/renderPage?shop_id=' + this.$route.params.shop_id + '&page=pages%2Findex%2Findex';
                    this.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(this.url);
                },

                share: function share() {
                    var text = '复制链接发给朋友：' + this.url;
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                },

                getInfo: function getInfo() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    that.loading = 1;

                    var user_info = app.getUserInfo();

                    app.get("mall/shop/find", {
                        id: this.$route.params.shop_id

                    }, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }

                        that.shop_info = res.data;
                    });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function (params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },

                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    bill_amount: "0.00",
                    shop_id: 0,
                    shop_info: {},
                    provider_shop_id: 0,
                    nodata: 0
                };
            },
            el: "#pageShopbill",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();
                this.getBillList();
            },

            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
            },
            methods: {
                // getShopInfo:function(){
                //     var that = this;
                //     app.get("/mall/shop/find",{

                //     },function(res){
                //          if(res.code==200){
                //              that.shop_info = res.data;
                //          }

                //     });
                // },

                getBillList: function getBillList() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    app.get("/mall/shop_bills/get", {
                        // shop_id:this.shop_id,
                        status: 0
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.bills_list = res.data.list;
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                },
                countPrice: function countPrice() {
                    var bill_amount = 0;
                    $("[name='checkbox1']:checked").each(function (i, checkbox) {
                        bill_amount += Number($(checkbox).attr("data-bill_entry_amount"));
                    });
                    this.bill_amount = bill_amount;
                },
                selectAll: function selectAll() {
                    if ($("[name='checkbox2']").prop("checked")) {
                        $("[name='checkbox1']").prop("checked", true);
                    } else {
                        $("[name='checkbox1']").prop("checked", false);
                    }

                    this.countPrice();
                },
                postOrder: function postOrder() {
                    var bill_entry_ids = [];
                    $("[name='checkbox1']:checked").each(function (i, checkbox) {
                        bill_entry_ids.push($(checkbox).attr("data-bill_entry_id"));
                    });
                    if (bill_entry_ids.length === 0) {
                        return;
                    }
                    app.post("/api/pay/shop_bills_order", {
                        bill_entry_id: bill_entry_ids.join(",")
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.pay(res.data.order_sn);
                    });
                    // console.log(bill_entry_ids);
                },

                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }

            }
        }).$mount("#app");
    };
    controller.pageShow = function () {};
    module.exports = controller;
});

'use strict';

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {

                    nodata: 0,
                    loading: 0,
                    list: [],
                    queryTime: ''

                };
            },
            el: '#pageStmtPayResultQuery',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                var that = this;
                // 时间
                app.datetimePickerWap("#time", {
                    title: '选择时间',
                    type: 'date',
                    // years: [2017, 2018],
                    // monthes: ['06', '07'],
                    onChange: function onChange(picker, values, displayValues) {
                        // console.log(picker);
                        var date = displayValues[0] + "-" + displayValues[1] + "-" + displayValues[2];
                        var time = displayValues[3] + ":" + displayValues[4];
                        var queryTime = date;
                        that.queryTime = queryTime;
                    },
                    onOpen: function onOpen(picker) {
                        $(".datetime-picker").on("close", function () {
                            // console.log("123");
                            that.getList();
                        });
                    }
                });
            },

            methods: {
                fetchData: function fetchData() {

                    this.getList();
                },
                getList: function getList() {
                    var that = this;
                    app.get("/apiv2/mch_my_bank/stmtPayResultQuery", {
                        // shop_id:this.shop_id,
                        queryTime: this.queryTime,
                        status: 0
                    }, function (res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.list = res.data;
                        if (that.list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                }

            }

        }).$mount('#app');
    };
    module.exports = controller;
});

"use strict";

define(function (require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function () {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    store_id: 0,
                    editData: {},
                    logoString: []
                };
            },
            el: '#pageUpdateStore',
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {

                if (this.mounted == 1) {
                    return;
                }

                this.mounted = 1;
            },

            methods: {
                fetchData: function fetchData() {
                    var _this = this;

                    this.store_id = this.$route.params.store_id;

                    if (this.store_id) {
                        this.getData();
                    }
                },
                getData: function getData() {
                    var that = this;
                    that.loading = 1;

                    app.get("api/user/info", {
                        fields: 'store'
                    }, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.editData = res.data.store;
                        if (that.editData.logo) {
                            that.logoString = JSON.stringify([{ name: 'logo', file_url: that.editData.logo }]);
                        }
                        that.$nextTick(function () {
                            app.upload($("#storeLogo"));
                        });
                    });
                },

                save: function save(id) {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    var post = {};
                    $("#formNewBook").find("input").each(function (i, input) {
                        post[$(input).attr('name')] = $(input).val();
                    });

                    app.post("apiv2/store/save", post, function (res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert('保存成功');
                        window.location.go(-1);
                    });
                }
            }

        }).$mount('#app');
    };
    module.exports = controller;
});

"use strict";

define("./js/account", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function(params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },
                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    bill_amount: "0.00",
                    shop_id: 0,
                    shop_info: {},
                    provider_shop_id: 0,
                    nodata: 0
                };
            },
            el: "#pageAccount",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();
                this.getBillList();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
            },
            methods: {
                // getShopInfo:function(){
                //     var that = this;
                //     app.get("/mall/shop/find",{
                //     },function(res){
                //          if(res.code==200){
                //              that.shop_info = res.data;
                //          }
                //     });
                // },
                getBillList: function getBillList() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    app.get("/mall/shop_bills/get", {
                        // shop_id:this.shop_id,
                        status: 0
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.bills_list = res.data.list;
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                },
                countPrice: function countPrice() {
                    var bill_amount = 0;
                    $("[name='checkbox1']:checked").each(function(i, checkbox) {
                        bill_amount += Number($(checkbox).attr("data-bill_entry_amount"));
                    });
                    this.bill_amount = bill_amount;
                },
                selectAll: function selectAll() {
                    if ($("[name='checkbox2']").prop("checked")) {
                        $("[name='checkbox1']").prop("checked", true);
                    } else {
                        $("[name='checkbox1']").prop("checked", false);
                    }
                    this.countPrice();
                },
                postOrder: function postOrder() {
                    var bill_entry_ids = [];
                    $("[name='checkbox1']:checked").each(function(i, checkbox) {
                        bill_entry_ids.push($(checkbox).attr("data-bill_entry_id"));
                    });
                    if (bill_entry_ids.length === 0) {
                        return;
                    }
                    app.post("/api/pay/shop_bills_order", {
                        bill_entry_id: bill_entry_ids.join(",")
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.pay(res.data.order_sn);
                    });
                },
                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }
            }
        }).$mount("#app");
    };
    controller.pageShow = function() {};
    module.exports = controller;
});

"use strict";

define("./js/addBook", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    editData: {}
                };
            },
            el: "#pageAddBook",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.shop_id = this.$route.params.shop_id;
                    this.id = this.$route.params.id;
                    if (this.id) {
                        this.getData();
                    }
                },
                getData: function getData() {
                    var that = this;
                    that.loading = 1;
                    app.get("mall/dining_table/find", {
                        shop_id: this.shop_id,
                        id: this.id
                    }, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.editData = res.data;
                    });
                },
                saveBook: function saveBook(id) {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    var post = {};
                    $("#formNewBook").find("input").each(function(i, input) {
                        post[$(input).attr("name")] = $(input).val();
                    });
                    app.post("mall/dining_table/add", post, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert("保存成功");
                        app.setPageData("index", {
                            reload: 0
                        });
                        that.$router.go(-1);
                    });
                },
                cancel: function cancel() {
                    this.$router.go(-1);
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/bankInfo", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    bankInfo: {},
                    showType: 1,
                    bankList: [],
                    bankSubbranchList: [],
                    contactline: "",
                    MerchantName: "",
                    MerchantId: "",
                    Fee: 0
                };
            },
            el: "#pageBankInfo",
            created: function created() {
                this.fetchData();
                app.area(".bankArea");
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.getBank();
                    this.getBankInfo();
                },
                getBankInfo: function getBankInfo() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    that.loading = 1;
                    var user_info = app.getUserInfo();
                    app.get("apiv2/mch_my_bank/merchantInfo", {}, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.bankInfo = res.data.BankCardParam;
                        // that.MerchantDetail = res.data.MerchantDetail;
                        that.MerchantName = res.data.MerchantName;
                        that.MerchantId = res.data.MerchantId;
                        that.Fee = res.data.FeeParamList[0].FeeValue * 100 + "%";
                    });
                },
                getBank: function getBank() {
                    var that = this;
                    app.get("apiv2/bank/getBank", {}, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.bankList = res.data;
                    });
                },
                getBankSubbranch: function getBankSubbranch() {
                    var that = this;
                    var data = {};
                    data.bankId = $("[name='BankName']").val();
                    // data.city_name=$("#bankCity").find("option:selected").text();
                    data.city_name = $("#bankCity option:selected").text();
                    if (!data.city_name) {
                        return;
                    }
                    app.get("apiv2/bank/getBankSubbranch", data, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.bankSubbranchList = res.data;
                    });
                },
                setContactLine: function setContactLine() {
                    var value = $("[name='BranchName']").val();
                    this.contactline = $("[name='BranchName']").find("[value='" + value + "']").attr("contactline");
                },
                saveBankInfo: function saveBankInfo() {
                    var that = this;
                    var data = $("#bankInfoForm").serializeArray();
                    data.push({
                        name: "method",
                        value: "updateMerchantBankCard"
                    });
                    app.post("/apiv2/mch_my_bank", data, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert("修改成功");
                        that.getBankInfo();
                        that.showType = 1;
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/billsRecords", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function(params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },
                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    nodata: 0,
                    shop_id: 0,
                    shop_info: {},
                    bill_amount: "0.00"
                };
            },
            el: "#pageBillsRecords",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();
                this.getBillList();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                var that = this;
                app.pager("#pageBillsRecords", function() {
                    that.getBillList();
                });
                this.mounted = 1;
            },
            methods: {
                getShopInfo: function getShopInfo() {
                    var that = this;
                    app.get("/mall/shop/find", {}, function(res) {
                        if (res.code == 200) {
                            that.shop_info = res.data;
                        }
                    });
                },
                getRoomInfo: function getRoomInfo() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    app.get("/api/community_rooms/find", {
                        out_room_id: out_room_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.room_info = res.data;
                    });
                },
                getBillList: function getBillList() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    var page = this.page;
                    if (that.lastPage == 1 || this.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    app.get("/mall/shop_bills/get", {
                        // shop_id:this.shop_id,
                        page: page,
                        limit: 20,
                        status: 1
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        // that.bills_list = res.data.list;
                        if (res.data.list.length === 0) {
                            that.lastPage = 1;
                        }
                        page++;
                        if (res.data.list.length > 0) {
                            that.setData({
                                page: page,
                                loading: 0,
                                bills_list: that.bills_list.concat(res.data.list)
                            });
                        }
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                },
                countPrice: function countPrice() {
                    var bill_amount = 0;
                    $("[name='checkbox1']:checked").each(function(i, checkbox) {
                        bill_amount += Number($(checkbox).attr("data-bill_entry_amount"));
                    });
                    this.bill_amount = bill_amount;
                },
                selectAll: function selectAll() {
                    if ($("[name='checkbox2']").prop("checked")) {
                        $("[name='checkbox1']").prop("checked", true);
                    } else {
                        $("[name='checkbox1']").prop("checked", false);
                    }
                    this.countPrice();
                },
                postOrder: function postOrder() {
                    var bill_entry_ids = [];
                    $("[name='checkbox1']:checked").each(function(i, checkbox) {
                        bill_entry_ids.push($(checkbox).attr("data-bill_entry_id"));
                    });
                    if (bill_entry_ids.length === 0) {
                        return;
                    }
                    app.post("/api/pay/community_bills_order", {
                        bill_entry_id: bill_entry_ids.join(",")
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.pay(res.data.order_sn);
                    });
                },
                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }
            }
        }).$mount("#app");
    };
    controller.pageShow = function() {};
    module.exports = controller;
});

"use strict";

define("./js/bindScanBox", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    show_qrcode_url: ""
                };
            },
            el: "#pageBindScanBox",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    // this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var that = this;
                    app.get("/apiv2/pay_request/bindScanBox/", {
                        shop_id: this.$route.params.shop_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(res.data);
                    });
                },
                share: function share() {
                    var text = "复制链接发给朋友：" + this.url;
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/book", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    items: [],
                    type: 1
                };
            },
            el: "#pageBook",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.shop_id = this.$route.params.shop_id;
                    this.getList();
                },
                getList: function getList() {
                    var that = this;
                    that.loading = 1;
                    app.get("mall/dining_table/get", {
                        shop_id: this.shop_id,
                        order: "id desc"
                    }, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.items = res.data.list;
                    });
                },
                preview: function preview() {
                    var user_info = app.getUserInfo();
                    var url = "/pages/book/?store_id=" + user_info.store_id + "#/";
                    window.location.href = url;
                },
                pageShow: function pageShow() {
                    var reload = app.getPageData("index", "reload");
                    // console.log(reload);
                    if (reload) {
                        app.setPageData("index", {
                            reload: 0
                        });
                        this.getList();
                    }
                },
                delBook: function delBook(id) {
                    var that = this;
                    app.confirm({
                        text: "确认删除吗？",
                        yes: function yes() {
                            app.get("mall/dining_table/del", {
                                id: id,
                                shop_id: this.shop_id
                            }, function(res) {
                                if (res.code != 200) {
                                    app.alert(res.msg);
                                    return;
                                }
                                that.getList();
                            });
                        }
                    });
                },
                shareUrl: function shareUrl() {
                    var store_id = app.getStoreId();
                    var url = "/apps/?app=book&store_id=" + store_id + "#/";
                    var shareUrl = encodeURIComponent("https://wap.bestsmartbee.com" + url);
                    this.$router.push({
                        name: "shareUrl",
                        params: {
                            url: shareUrl
                        }
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/chooseGoods", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    goods: [],
                    ids: {},
                    tags: []
                };
            },
            el: "#pageChooseGoods",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.shop_id = this.$route.params.shop_id;
                    this.id = this.$route.params.id;
                    this.loadids();
                    this.getTags();
                },
                loadids: function loadids() {
                    var that = this;
                    that.goods = [];
                    var params = {
                        shop_id: this.shop_id,
                        limit: 100,
                        attr_id: this.id,
                        status: 1,
                        fields: "goods_name,attr_id,id,default_img"
                    };
                    app.get("mall/goods/get", params, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        var ids = {};
                        for (var i in res.data.list) {
                            ids[res.data.list[i].id] = res.data.list[i].id;
                        }
                        that.ids = ids;
                        that.loadGoods();
                    });
                },
                loadGoods: function loadGoods() {
                    var that = this;
                    that.goods = [];
                    var params = {
                        shop_id: this.shop_id,
                        limit: 100,
                        fields: "goods_name,attr_id,id,default_img"
                    };
                    if (this.attr_id) {
                        params.attr_id = this.attr_id;
                    }
                    if (this.kw) {
                        params.kw = this.kw;
                    }
                    app.get("mall/goods/get", params, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        var goods = [];
                        var good = {};
                        for (var i in res.data.list) {
                            good = res.data.list[i];
                            if (that.ids[good.id]) {
                                good.choose = 1;
                            }
                            goods.push(good);
                        }
                        that.goods = goods;
                    });
                },
                tag: function tag(e, goods_id) {
                    if ($(e.target).prop("checked")) {
                        this.addTag(goods_id);
                    } else {
                        this.delTag(goods_id);
                    }
                },
                delTag: function delTag(goods_id) {
                    var that = this;
                    app.get("mall/goods/delTag", {
                        goods_id: goods_id,
                        shop_id: this.shop_id,
                        attr_id: this.id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.ids[goods_id] = 0;
                        app.setPageData("index", {
                            reload: 1
                        });
                    });
                },
                addTag: function addTag(goods_id) {
                    var that = this;
                    app.get("mall/goods/addTag", {
                        goods_id: goods_id,
                        shop_id: this.shop_id,
                        attr_id: this.id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.ids[goods_id] = goods_id;
                        app.setPageData("index", {
                            reload: 1
                        });
                    });
                },
                getTags: function getTags() {
                    var that = this;
                    app.get("mall/tag/get", {
                        shop_id: this.shop_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.tags = res.data.list;
                        Vue.nextTick(function() {
                            that.select();
                        });
                    });
                },
                select: function select() {
                    var that = this;
                    var $eventSelect = $("#pageChooseGoods #tag_name");
                    $eventSelect.select2({
                        placeholder: "请选择分类名称或商品名称",
                        allowClear: false,
                        tags: true
                    });
                    $eventSelect.on("select2:select", function(e) {
                        var data = $(this).select2("data")[0];
                        if (Number(data.id) > 0) {
                            that.attr_id = data.id;
                            that.kw = "";
                        } else {
                            that.attr_id = 0;
                            that.kw = data.id;
                        }
                        console.log(data);
                        that.loadGoods();
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/goods", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    var goodslist = {};
    var goods_spec = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    shoppingCartList: [],
                    goods: {},
                    tabid: -1,
                    popup: 0,
                    popup2: 0,
                    data: {},
                    choose_property_data: {},
                    choose_spec: {},
                    disabled: 0,
                    spec_keys_str: "",
                    goods_in_cart: {},
                    tag_list: []
                };
            },
            el: "#pageGoods",
            created: function created() {
                this.fetchData();
            },
            methods: {
                fetchData: function fetchData() {
                    var that = this;
                    this.shop_id = this.$route.params.shop_id;
                    var user_info = app.getUserInfo();
                    if (this.shop_id > 0) {
                        this.getShopInfo();
                        this.getTagList();
                    } else {
                        app.component("get_shop_id", {
                            success: function success(shop_id) {
                                that.shop_id = shop_id;
                                that.$router.push({
                                    name: "goods",
                                    params: {
                                        shop_id: shop_id
                                    }
                                });
                            }
                        });
                    }
                },
                setData: function setData(arr) {
                    for (var i in arr) {
                        // console.log(i);
                        // console.log(arr[i]);
                        // this.$set(i,arr[i]); 
                        this[i] = arr[i];
                    }
                },
                // 商铺信息
                getShopInfo: function getShopInfo() {
                    var that = this;
                    app.get("mall/shop/find", {
                        shop_id: this.shop_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        } else if (res.data) {
                            that.shop_info = res.data;
                        }
                    });
                },
                // 标签列表
                getTagList: function getTagList() {
                    var that = this;
                    app.get("mall/tag/get", {
                        shop_id: this.shop_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        } else if (res.data) {
                            that.tag_list = res.data.list;
                            that.showTabs(0);
                        }
                    });
                },
                //商品列表
                loadList: function loadList(reload) {
                    var that = this;
                    var attr_id = this.attr_id;
                    if (that.goods[attr_id] && that.goods[attr_id].length > 0) {
                        return;
                    }
                    app.get("mall/goods/get", {
                        attr_id: this.attr_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        if (res.data && res.data.list) {
                            goodslist[attr_id] = res.data.list;
                        } else {
                            goodslist[attr_id] = [];
                        }
                        var that_goods = that.goods;
                        var goods = [];
                        for (var k in goodslist[attr_id]) {
                            var item = goodslist[attr_id][k];
                            goods.push({
                                default_img: item["default_img"],
                                goods_name: item["goods_name"],
                                origin_price: item["origin_price"],
                                price: item["price"],
                                total_stock: item["total_stock"],
                                sub_title: item["sub_title"],
                                id: item["id"],
                                status: item["status"]
                            });
                        }
                        that.goods = {};
                        that_goods[attr_id] = goods;
                        that.goods = that_goods;
                    });
                },
                showTabs: function showTabs(index) {
                    if (this.tabid == index) {
                        return;
                    }
                    var tag = this.tag_list[index];
                    // console.log(tag);
                    this.attr_id = tag.id;
                    this.setData({
                        tabid: index
                    });
                    this.loadList();
                },
                deleteRowMallGoods: function deleteRowMallGoods(attr_id, idx2, id) {
                    // console.log(idx2);
                    var that = this;
                    var goods = this.goods;
                    app.get("/mall-admin/mall-goods/delete", {
                        shop_id: this.shop_id,
                        ids: id
                    }, function(data) {
                        if (data.error === 0) {
                            var status = goods[attr_id][idx2].status;
                            goods[attr_id][idx2].status = status == 1 ? 2 : 1;
                            // console.log(status);
                            //  console.log(goods);
                            that.goods = [];
                            that.goods = goods;
                        } else {
                            app.alert(data.msg);
                        }
                    });
                },
                editGoods: function editGoods(id) {
                    var user_info = app.getUserInfo();
                    var url = "https://www.bestsmartbee.com/mall-admin/mall-goods/add?id=" + id + "&token=" + user_info.token + "&shop_id=" + this.shop_id;
                    // console.log(url);
                    window.location.href = url;
                },
                newGoods: function newGoods(id) {
                    var user_info = app.getUserInfo();
                    var url = "https://www.bestsmartbee.com/mall-admin/mall-goods/add?shop_id=" + this.shop_id + "&token=" + user_info.token;
                    // console.log(url);
                    window.location.href = url;
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/index", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    items: [],
                    type: 1
                };
            },
            el: "#pageIndex",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.shop_id = this.$route.params.shop_id;
                    this.type = this.$route.params.type;
                    if (this.type == 1) {
                        app.setTitle("外卖分类");
                    } else if (this.type == 2) {
                        app.setTitle("到店扫码点餐分类");
                    }
                    this.init();
                },
                getList: function getList() {
                    var that = this;
                    that.loading = 1;
                    console.log(that.$route.params);
                    app.get("mall/tag/getByType", {
                        shop_id: this.shop_id,
                        type: that.$route.params.type + ",12"
                    }, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.items = res.data;
                    });
                },
                preview: function preview() {
                    var url = "";
                    var store_id = app.getStoreId();
                    if (this.type == 1) {
                        url = "/apps/app=takeout&store_id=" + store_id + "#/" + this.shop_id;
                    } else {
                        url = "/apps/?app=eat_in_hall&store_id=" + store_id + "#/shop_id/" + this.shop_id;
                    }
                    window.location.href = url;
                },
                pageShow: function pageShow() {
                    var reload = app.getPageData("index", "reload");
                    // console.log(reload);
                    if (reload) {
                        app.setPageData("index", {
                            reload: 0
                        });
                        this.getList();
                    }
                },
                init: function init() {
                    if (this.shop_id > 0) {
                        this.getList();
                    } else {
                        var that = this;
                        app.component("get_shop_id", {
                            success: function success(shop_id) {
                                that.shop_id = shop_id;
                                app.setPageData("index", {
                                    shop_id: shop_id
                                });
                                // console.log("get_shop_id",shop_id);
                                // that.$router.go(-1);
                                that.$router.push({
                                    name: "index",
                                    params: {
                                        shop_id: shop_id,
                                        type: that.type
                                    }
                                });
                            }
                        });
                    }
                },
                eat_in_hall_pay_setting: function eat_in_hall_pay_setting() {
                    var user_info = app.getUserInfo();
                    var url = "https://www.bestsmartbee.com/mall-admin/mall-promotion/add?from=webapp&from_wx_app=1&token=" + user_info.token + "&name=eat_in_hall_pay&shop_id=" + this.shop_id;
                    window.location.href = url;
                },
                freight_setting: function freight_setting() {
                    var user_info = app.getUserInfo();
                    var url = "https://www.bestsmartbee.com/mall-admin/mall_promotion/index?from=webapp&from_wx_app=1&token=" + user_info.token + "&shop_id=" + this.shop_id;
                    window.location.href = url;
                },
                shareUrl: function shareUrl() {
                    var store_id = app.getStoreId();
                    var url = "";
                    if (this.type == 1) {
                        url = "/pages/takeout/?store_id=" + store_id + "#/" + this.shop_id;
                    } else {
                        url = "/pages/eat_in_hall/?store_id=" + store_id + "#/shop_id/" + this.shop_id;
                    }
                    var shareUrl = encodeURIComponent("https://wap.bestsmartbee.com" + url);
                    this.$router.push({
                        name: "shareUrl",
                        params: {
                            url: shareUrl
                        }
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/main", [ "app" ], function(require) {
    var PuthinkApp = require("app");
    //vue 组件
    // require('js/component');
    //zach
    //配置文件
    var params = {
        apiDomain: seajs.data.apiDomain ? seajs.data.apiDomain : "https://www.bestsmartbee.com/",
        //接口域名 不带"/"
        domain: "",
        //网站域名  不带"/",
        appname: seajs.data.appname,
        debug: seajs.data.debug ? seajs.data.debug : false,
        versions: seajs.data.versions ? seajs.data.versions : "6.8",
        userVersions: seajs.data.userVersions ? seajs.data.userVersions : "6.9"
    };
    //app 实例之后 ， 只执行一次
    PuthinkApp.afterInit = function() {
        var _hmt = _hmt || [];
    };
    //页面显示时引用，每次都会执行
    PuthinkApp.pageShow = function(params) {
        var name = params.name;
    };
    //实例化app
    window.app = new PuthinkApp(params);
    app.login(function() {
        app.init();
    });
});

"use strict";

define("./js/merchantInfo", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    merchantInfo: {},
                    MerchantName: "",
                    MerchantId: "",
                    showType: 1,
                    storeData: {},
                    logoString: []
                };
            },
            el: "#pageMerchantInfo",
            created: function created() {
                this.fetchData();
                // app.area(".DestinationArea");
                var _this = this;
                app.cityPicker("#DestinationArea", {
                    title: "选择地区",
                    onChange: function onChange(picker, values, displayValues) {
                        console.log(values);
                        //   console.log( displayValues);
                        _this.destinationAreaValues = values;
                        _this.destinationArea = displayValues;
                        $("#District").val(values[2]);
                        $("#City").val(values[1]);
                        $("#Province").val(values[0]);
                    }
                });
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.getInfo();
                    this.getStoreData();
                },
                getInfo: function getInfo() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    that.loading = 1;
                    var user_info = app.getUserInfo();
                    app.get("apiv2/mch_my_bank/merchantInfo", {}, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.merchantInfo = res.data.MerchantDetail;
                        // that.MerchantDetail = res.data.MerchantDetail;
                        that.MerchantName = res.data.MerchantName;
                        that.MerchantId = res.data.MerchantId;
                    });
                },
                getStoreData: function getStoreData() {
                    var that = this;
                    that.loading = 1;
                    app.get("api/user/info", {
                        fields: "store"
                    }, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.storeData = res.data.store;
                        if (that.storeData.logo) {
                            that.logoString = JSON.stringify([ {
                                name: "logo",
                                file_url: that.storeData.logo
                            } ]);
                        }
                        that.$nextTick(function() {
                            app.upload($("#storeLogo"));
                        });
                    });
                },
                saveStore: function saveStore() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    var post = {
                        logo: $('[name="logo"]').val(),
                        store_id: $('[name="store_id"]').val(),
                        store_name: $('[name="Alias"]').val(),
                        phone: $('[name="ContactMobile"]').val(),
                        address: $('[name="DestinationArea"]').val() + $('[name="Address"]').val()
                    };
                    // $("#formNewBook").find("input").each(function(i,input){
                    //    post[$(input).attr('name')] = $(input).val();
                    // });
                    app.post("apiv2/store/save", post, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                    });
                },
                updateMerchantInfo: function updateMerchantInfo() {
                    this.saveStore();
                    var that = this;
                    var data = $("#InfoForm").serializeArray();
                    data.push({
                        name: "method",
                        value: "updateMerchantInfo"
                    });
                    app.post("/apiv2/mch_my_bank", data, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert("修改成功");
                        that.getInfo();
                        that.showType = 1;
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/newCate", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_id: 0,
                    type: 1,
                    id: 0,
                    editData: {},
                    tags: [],
                    goods: [],
                    tag_name: ""
                };
            },
            el: "#pageNewCate",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.shop_id = this.$route.params.shop_id;
                    this.type = this.$route.params.type;
                    this.id = this.$route.params.id;
                    if (this.id > 0) {
                        this.initTag();
                    } else {
                        this.getTags();
                    }
                },
                select: function select() {
                    var that = this;
                    var $eventSelect = $("#pageNewCate #tag_name");
                    $eventSelect.select2({
                        placeholder: "请输入分类名称",
                        allowClear: false,
                        tags: true
                    });
                    $eventSelect.on("select2:select", function(e) {
                        var data = $(this).select2("data")[0];
                        if (Number(data.id) > 0) {
                            that.id = data.id;
                        }
                        that.saveTagName(data.text);
                    });
                },
                saveTagByInput: function saveTagByInput() {
                    this.tag_name = $("#tag_name").val();
                    this.saveTagName(this.tag_name);
                },
                saveTagName: function saveTagName(name) {
                    var that = this;
                    app.post("mall/tag/add", {
                        name: name,
                        type: this.type,
                        id: this.id,
                        order_by: $("#order_by").val() ? $("#order_by").val() : 999,
                        shop_id: this.shop_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        // if(that.id != res.data.id){
                        //   that.loadGoods();
                        //   that.id = res.data.id;
                        // }
                        that.loadGoods();
                        that.id = res.data.id;
                        that.editData = res.data;
                        app.setPageData("index", {
                            reload: 1
                        });
                        $(".select2").remove();
                    });
                },
                getTags: function getTags() {
                    var that = this;
                    app.get("mall/tag/get", {
                        shop_id: this.shop_id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.tags = res.data.list;
                        Vue.nextTick(function() {
                            that.select();
                        });
                    });
                },
                initTag: function initTag() {
                    var that = this;
                    app.get("mall/tag/find", {
                        id: this.id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.editData = res.data;
                    });
                },
                loadGoods: function loadGoods() {
                    var that = this;
                    that.goods = [];
                    app.get("mall/goods/get", {
                        attr_id: this.id,
                        shop_id: this.shop_id,
                        status: 1,
                        limit: 100
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.goods = res.data.list;
                    });
                },
                showAct: function showAct(goods_id, index) {
                    var that = this;
                    var params = [ {
                        text: "删除",
                        methods: function methods() {
                            app.colseHandle();
                            that.delete(goods_id, index);
                        }
                    } ];
                    app.handle(params);
                },
                delTag: function delTag() {
                    var that = this;
                    var goods = this.goods;
                    app.confirm({
                        text: "确认删除些分类吗？",
                        yes: function yes() {
                            app.get("mall/tag/del", {
                                id: that.id
                            }, function(res) {
                                if (res.code != 200) {
                                    app.alert(res.msg);
                                    return;
                                }
                                app.setPageData("index", {
                                    reload: 1
                                });
                                that.$router.go(-1);
                            });
                        }
                    });
                },
                "delete": function _delete(goods_id, index) {
                    var that = this;
                    var goods = this.goods;
                    app.get("mall/goods/delTag", {
                        goods_id: goods_id,
                        shop_id: this.shop_id,
                        attr_id: this.id
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.setPageData("index", {
                            reload: 1
                        });
                        goods.splice(index, 1);
                    });
                },
                pageShow: function pageShow() {
                    // console.log('pageShow');
                    this.loadGoods();
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/providerShopbill", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function(params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },
                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    nodata: 0,
                    shop_id: 0,
                    status: "",
                    shop_info: {},
                    bill_amount: "0.00"
                };
            },
            el: "#pageProviderShopbill",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();
                this.getBillList();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                var that = this;
                app.pager("#pageBillsRecords", function() {
                    that.getBillList();
                });
                this.mounted = 1;
            },
            methods: {
                setStatus: function setStatus(status) {
                    // this.bills_list=[];
                    this.status = status;
                    this.getBillList(1);
                },
                getBillList: function getBillList() {
                    var reload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
                    if (reload == 1) {
                        this.setData({
                            page: 1,
                            loading: 0,
                            bills_list: [],
                            lastPage: 0,
                            nodata: 0
                        });
                    }
                    var that = this;
                    var page = this.page;
                    if (that.lastPage == 1 || this.loading == 1) {
                        return;
                    }
                    var params = {
                        page: page,
                        limit: 20
                    };
                    if (this.status !== "") {
                        params.status = this.status;
                    }
                    this.loading = 1;
                    app.get("/mall/shop_bills/get", params, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        // that.bills_list = res.data.list;
                        if (res.data.list.length === 0) {
                            that.lastPage = 1;
                        }
                        page++;
                        if (res.data.list.length > 0) {
                            that.setData({
                                page: page,
                                loading: 0,
                                bills_list: that.bills_list.concat(res.data.list)
                            });
                        }
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        } else {
                            that.nodata = 0;
                        }
                    });
                },
                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }
            }
        }).$mount("#app");
    };
    controller.pageShow = function() {};
    module.exports = controller;
});

"use strict";

define("./js/router", [], function(require, exports, module) {
    var Router = new VueRouter({
        routes: [ {
            path: "/:shop_id/:type",
            name: "index",
            title: ""
        }, {
            path: "/newCate/:shop_id/:type/:id",
            name: "newCate",
            title: "编辑分类"
        }, {
            path: "/chooseGoods/:shop_id/:id",
            name: "chooseGoods",
            title: "选择商品"
        }, {
            path: "/shopQCode/shop_id/:shop_id",
            name: "shopQCode",
            title: "门店名片"
        }, {
            path: "/goods/list/:shop_id",
            name: "goods",
            title: "商品库"
        }, {
            path: "/bankInfo",
            name: "bankInfo",
            title: "银行卡信息"
        }, {
            path: "/merchantInfo",
            name: "merchantInfo",
            title: "商户信息"
        }, {
            path: "/book/list/:shop_id",
            name: "book",
            title: "预约设置"
        }, {
            path: "/book/add/:shop_id/:id",
            name: "addBook",
            title: "预约设置"
        }, {
            path: "/store/update/:store_id",
            name: "updateStore",
            title: "商户信息"
        }, {
            path: "/shopbill/shop_id/:shop_id",
            name: "shopbill",
            title: "佣金账单"
        }, {
            path: "/providerShopbill/shop_id/:shop_id",
            name: "providerShopbill",
            title: "佣金账单"
        }, {
            path: "/billsRecords/shop_id/:shop_id",
            name: "billsRecords",
            title: "历史账单"
        }, {
            path: "/stmtPayResultQuery",
            name: "stmtPayResultQuery",
            title: "结算打款记录"
        }, {
            path: "/shareUrl/url/:url",
            name: "shareUrl",
            title: "分享链接"
        }, {
            path: "/bindScanBox/shop_id/:shop_id",
            name: "bindScanBox",
            title: "绑定支付盒子"
        } ]
    });
    module.exports = Router;
});

"use strict";

define("./js/shareLink", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    downUrl: ""
                };
            },
            el: "#pageShopQCode",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                app.copy("#shareClipboard", function(res) {
                    console.log(res);
                    if (res == "success") {
                        app.alert("链接复制成功");
                    } else {
                        this.share();
                    }
                });
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var user_info = app.getUserInfo();
                    this.url = app.params.apiDomain + "/mall/pages/renderPage?shop_id=" + this.$route.params.shop_id + "&page=pages%2Findex%2Findex";
                    this.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(this.url);
                },
                share: function share() {
                    var text = "复制链接发给朋友：" + this.url;
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/shareUrl", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    downUrl: ""
                };
            },
            el: "#pageShareUrl",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                app.copy("#shareClipboard", function(res) {
                    console.log(res);
                    if (res == "success") {
                        app.alert("链接复制成功");
                    } else {
                        this.share();
                    }
                });
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    // this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var user_info = app.getUserInfo();
                    this.url = decodeURIComponent(this.$route.params.url);
                    this.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(this.url);
                },
                share: function share() {
                    var text = "复制链接发给朋友：" + decodeURIComponent(this.url);
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/shopQCode", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    shop_info: {},
                    store: {},
                    loading: 0,
                    cardQrcodeInfo: {},
                    downUrl: ""
                };
            },
            el: "#pageShopQCode",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                app.copy("#shareClipboard", function(res) {
                    console.log(res);
                    if (res == "success") {
                        app.alert("链接复制成功");
                    } else {
                        this.share();
                    }
                });
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.getInfo();
                    this.getCardQrcode();
                },
                getCardQrcode: function getCardQrcode() {
                    //如果是微信打开卡包
                    var user_info = app.getUserInfo();
                    this.url = app.params.apiDomain + "/mall/pages/renderPage?shop_id=" + this.$route.params.shop_id + "&page=pages%2Findex%2Findex";
                    this.show_qrcode_url = app.params.apiDomain + "/api/index/urlQRcode?url=" + encodeURIComponent(this.url);
                },
                share: function share() {
                    var text = "复制链接发给朋友：" + this.url;
                    if (app.isWeiXin()) {
                        text = "请点击微信右上角分享给好友";
                    }
                    app.confirm({
                        text: text
                    });
                },
                getInfo: function getInfo() {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    that.loading = 1;
                    var user_info = app.getUserInfo();
                    app.get("mall/shop/find", {
                        id: this.$route.params.shop_id
                    }, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.shop_info = res.data;
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/shopbill", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function(params) {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    user_info: {
                        community: {},
                        tenement_type: []
                    },
                    page: 1,
                    lastPage: 0,
                    mounted: 0,
                    room_info: {},
                    showNoData: 0,
                    bills_list: [],
                    bill_amount: "0.00",
                    shop_id: 0,
                    shop_info: {},
                    provider_shop_id: 0,
                    nodata: 0
                };
            },
            el: "#pageShopbill",
            created: function created() {
                this.shop_id = this.$route.params.shop_id;
                // this.getShopInfo();
                this.getBillList();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
            },
            methods: {
                // getShopInfo:function(){
                //     var that = this;
                //     app.get("/mall/shop/find",{
                //     },function(res){
                //          if(res.code==200){
                //              that.shop_info = res.data;
                //          }
                //     });
                // },
                getBillList: function getBillList() {
                    var out_room_id = this.$route.params.out_room_id;
                    var that = this;
                    app.get("/mall/shop_bills/get", {
                        // shop_id:this.shop_id,
                        status: 0
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.bills_list = res.data.list;
                        if (that.bills_list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                },
                countPrice: function countPrice() {
                    var bill_amount = 0;
                    $("[name='checkbox1']:checked").each(function(i, checkbox) {
                        bill_amount += Number($(checkbox).attr("data-bill_entry_amount"));
                    });
                    this.bill_amount = bill_amount;
                },
                selectAll: function selectAll() {
                    if ($("[name='checkbox2']").prop("checked")) {
                        $("[name='checkbox1']").prop("checked", true);
                    } else {
                        $("[name='checkbox1']").prop("checked", false);
                    }
                    this.countPrice();
                },
                postOrder: function postOrder() {
                    var bill_entry_ids = [];
                    $("[name='checkbox1']:checked").each(function(i, checkbox) {
                        bill_entry_ids.push($(checkbox).attr("data-bill_entry_id"));
                    });
                    if (bill_entry_ids.length === 0) {
                        return;
                    }
                    app.post("/api/pay/shop_bills_order", {
                        bill_entry_id: bill_entry_ids.join(",")
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.pay(res.data.order_sn);
                    });
                },
                setData: function setData(data) {
                    for (var i in data) {
                        this[i] = data[i];
                    }
                }
            }
        }).$mount("#app");
    };
    controller.pageShow = function() {};
    module.exports = controller;
});

"use strict";

define("./js/stmtPayResultQuery", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    nodata: 0,
                    loading: 0,
                    list: [],
                    queryTime: ""
                };
            },
            el: "#pageStmtPayResultQuery",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
                var that = this;
                // 时间
                app.datetimePickerWap("#time", {
                    title: "选择时间",
                    type: "date",
                    // years: [2017, 2018],
                    // monthes: ['06', '07'],
                    onChange: function onChange(picker, values, displayValues) {
                        // console.log(picker);
                        var date = displayValues[0] + "-" + displayValues[1] + "-" + displayValues[2];
                        var time = displayValues[3] + ":" + displayValues[4];
                        var queryTime = date;
                        that.queryTime = queryTime;
                    },
                    onOpen: function onOpen(picker) {
                        $(".datetime-picker").on("close", function() {
                            // console.log("123");
                            that.getList();
                        });
                    }
                });
            },
            methods: {
                fetchData: function fetchData() {
                    this.getList();
                },
                getList: function getList() {
                    var that = this;
                    app.get("/apiv2/mch_my_bank/stmtPayResultQuery", {
                        // shop_id:this.shop_id,
                        queryTime: this.queryTime,
                        status: 0
                    }, function(res) {
                        if (res.code != 200) {
                            app.alert(res.msg);
                        }
                        that.list = res.data;
                        if (that.list.length === 0) {
                            that.nodata = 1;
                        }
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

"use strict";

define("./js/updateStore", [ "router" ], function(require, exports, module) {
    var router = require("router");
    //var app = require("app");
    var controller = {};
    controller.vue = function() {
        controller.vm = new Vue({
            router: router,
            data: function data() {
                return {
                    store_id: 0,
                    editData: {},
                    logoString: []
                };
            },
            el: "#pageUpdateStore",
            created: function created() {
                this.fetchData();
            },
            mounted: function mounted() {
                if (this.mounted == 1) {
                    return;
                }
                this.mounted = 1;
            },
            methods: {
                fetchData: function fetchData() {
                    var _this = this;
                    this.store_id = this.$route.params.store_id;
                    if (this.store_id) {
                        this.getData();
                    }
                },
                getData: function getData() {
                    var that = this;
                    that.loading = 1;
                    app.get("api/user/info", {
                        fields: "store"
                    }, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        that.editData = res.data.store;
                        if (that.editData.logo) {
                            that.logoString = JSON.stringify([ {
                                name: "logo",
                                file_url: that.editData.logo
                            } ]);
                        }
                        that.$nextTick(function() {
                            app.upload($("#storeLogo"));
                        });
                    });
                },
                save: function save(id) {
                    var that = this;
                    if (that.loading == 1) {
                        return;
                    }
                    this.loading = 1;
                    var post = {};
                    $("#formNewBook").find("input").each(function(i, input) {
                        post[$(input).attr("name")] = $(input).val();
                    });
                    app.post("apiv2/store/save", post, function(res) {
                        that.loading = 0;
                        if (res.code != 200) {
                            app.alert(res.msg);
                            return;
                        }
                        app.alert("保存成功");
                        window.location.go(-1);
                    });
                }
            }
        }).$mount("#app");
    };
    module.exports = controller;
});

define("./template_js/account", [], function(require, exports, module) {
    return '<div class="page-content">    <section>	   <section class="errormsgDiv" v-if="nodata==1">	    <p class="errormsg">（￣︶￣）/</p>	    <p class="errormsg2">暂无记录</p>	  </section>		     	<div class="weui_cells weui_cells_checkbox" v-else>	        <label class="weui_cell weui_check_label"  v-for="item in bills_list" >	             	            <div class="weui_cell_bd weui_cell_primary">	            	  <div class="fl">	            	  	 <p>支付 [{{item.provider_shop.name}}] 推广金 {{item.amount}} 元</p>		                  <p class="light">订单号{{item.order_sn}} ，订单交易额￥{{item.order_amount}}，佣金比例{{item.commission}}</p>		                  <p class="light">{{item.createtime}}</p>		                 	            	  </div>	            	   <div >	            	  	 		                 <div class="s_right"  style="color: #c00; margin-top: 5px">打款成功</div> 		                  <div class="clear"></div>	            	  </div>	            	 	                  	            </div>	        </label>	        	    </div>	    <div style="height: 80px"></div>    </section></div>';
});

define("./template_js/addBook", [], function(require, exports, module) {
    return '<div class="page-content">		<form  id="formNewBook"  >		     <div class="weui_cells weui_cells_form">		            <div class="weui_cell">		                <div class="weui_cell_hd"><label style="width: 76px;" class="weui_label">名称</label></div>		                <div class="weui_cell_bd weui_cell_primary">		                    <input class="weui_input" type="text" name="name" :value="editData.name" placeholder="请输入名称">		                    <input type="hidden" name="id" :value="editData.id">		                    <input type="hidden" name="shop_id" :value="shop_id">		                    		                </div>		            </div>		            <div class="weui_cell">		                <div class="weui_cell_hd"><label style="width: 76px;"   class="weui_label">预约费用</label></div>		                <div class="weui_cell_bd weui_cell_primary">		                    <input class="weui_input" type="number" name="money" :value="editData.money"  placeholder="请输入预约费用">		                </div>		                 		            </div> 		            <div class="weui_cell">		                <div class="weui_cell_hd"><label  style="width: 76px;"  class="weui_label">说明</label></div>		                <div class="weui_cell_bd weui_cell_primary">		                    <input class="weui_input" type="text" name="remark" :value="editData.remark" placeholder="请输入说明">		                </div>		                		            </div>		        </div>		    <div style="padding: 20px 10px;">		    	<div class="btn btn2 w100" @click=\'saveBook()\'>保存</div>  		    	 <a  @click="cancel"  class="btn btn3 w100 mgt10">取消</a>		     	 		   </div>      		</form></div>';
});

define("./template_js/bankInfo", [], function(require, exports, module) {
    return '<div class="page-content">	<section v-if="showType==1">	<div class="weui_cells_title">结算银行卡信息</div>	  <div class="weui_cells">	  				  				 <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{MerchantName}}</p>                        </div>                        <div class="weui_cell_ft">                            商户名                        </div>                                             </div>                     <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p style="color: red">{{Fee}}</p>                        </div>                        <div class="weui_cell_ft" >                            结算费率                        </div>                                             </div>                                        <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{bankInfo.BranchName}}</p>                        </div>                        <div class="weui_cell_ft">                            银行                        </div>                                             </div>                      <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{bankInfo.BankCardNo}}</p>                        </div>                        <div class="weui_cell_ft">                            银行卡号                        </div>                                             </div>                                                                                     <div class="weui_cell" v-if="bankInfo.AccountType==\'01\'">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{bankInfo.BankCertName}}</p>                        </div>                        <div class="weui_cell_ft">                            持卡人                        </div>                                             </div>                                         <div class="weui_cell" v-if="bankInfo.AccountType==\'01\'">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{bankInfo.CertNo}}</p>                        </div>                        <div class="weui_cell_ft">                            身份证                        </div>                                             </div>                </div>                 <div class="weui_opr_area" >			        <p class="weui_btn_area">			            <a v-on:click="showType=2" class="weui_btn  btn2">修改银行卡</a>			            			        </p>			    </div>    </section>    <form id="bankInfoForm" :style="showType==1?\'display: none;\':\'\'"   >      	<div class="weui_cells_title">结算银行卡信息</div>		   	 <div class="list-li">			       				       		<div class="li"  v-if="bankInfo.AccountType==\'01\'">			            	<div class="li-input-text">持卡人</div>				            <div class="li-input">				              <input readonly  maxlength="40" placeholder=\'请输入负责人姓名\'   :value="bankInfo.BankCertName"  name=\'BankCertName\'></input>				            </div>				            <div class="clear"></div>			         	 </div> 			         	 <div class="li"  v-if="bankInfo.AccountType==\'01\'">			            	<div class="li-input-text">身份证</div>				            <div class="li-input">				              <input readonly  maxlength="40" placeholder=\'请输入负责人身份证\'   :value="bankInfo.CertNo"  name=\'CertNo\'></input>				            </div>				            <div class="clear"></div>			         	 </div> 			         	  <div class="li"  v-if="bankInfo.AccountType==\'01\'">			            	<div class="li-input-text">持卡人地址</div>				            <div class="li-input">				              <input  maxlength="40" placeholder=\'请输入开户地\'   :value="bankInfo.CardHolderAddress"  name=\'CardHolderAddress\'></input>				            </div>				            <div class="clear"></div>			         	 </div> 			         	 <div class="li"  v-if="bankInfo.AccountType==\'02\'">			            	<div class="li-input-text">对公银行卡号</div>				            <div class="li-input">				              <input  maxlength="40" placeholder=\'请输入对公银行卡号\' type="number" :value="bankInfo.BankCardNo"   name=\'BankCardNo\'></input>				            </div>				            <div class="clear"></div>			         	 </div> 			         	  			         	  <div class="li"  v-else>			            	<div class="li-input-text">银行卡号</div>				            <div class="li-input">				              <input  maxlength="40" placeholder=\'请输入负责人银行卡号\' type="number"  :value="bankInfo.BankCardNo"  name=\'BankCardNo\'></input>				            </div>				            <div class="clear"></div>			         	 </div> 		 			         	  <div class="li"  >			            	<div class="li-input-text">开户银行</div>				            <div class="li-input">				             <select name="BankName" id="bankName" v-on:change=\'getBankSubbranch($event)\' >				             	<option value="">请选择银行</option>				             	<option   v-for="bank in bankList"  :value="bank.bankId">{{bank.bankName}}</option></select>				              				            </div>				            <div class="clear"></div>			         	 </div> 			         	  <div class="li"  >			            	<div class="li-input-text">银行省市区</div>				            <div class="li-input bankArea">				              <select class=" fl province form-control" style="width:33%;"  name="BranchProvince" id="BranchProvince" >										<option value="">请选择</option>									</select>									<select id="bankCity" v-on:change=\'getBankSubbranch($event)\' class=" fl city form-control" style="width:33%;" name="BranchCity">										<option value="">请选择</option>									</select>									 <input type="hidden" class="hide-value" value="" name="bankHideCode"  />									 				            </div>				            <div class="clear"></div>			         	 </div> 			         	 <div class="li"  >			            	<div class="li-input-text">开户支行名称</div>				            <div class="li-input">				             <select name="BranchName" v-on:change=\'setContactLine($event)\'>				             	<option value="0">请选择支行</option>				             	<option  v-for="bankSubbranch in bankSubbranchList" :contactLine="bankSubbranch.contactLine"  :value="bankSubbranch.sub_bankName">{{bankSubbranch.sub_bankName}}</option></select>				             				             </select>				              <input type="hidden" name="ContactLine" :value="contactline">				               <input type="hidden" name="MerchantId" :value="MerchantId">				                <input type="hidden" name="AccountType" :value="bankInfo.AccountType">				               				             				            </div>				            <div class="clear"></div>			         	 </div> 			         	 	   		 			   </div>			    <div class="weui_opr_area" >			        <p class="weui_btn_area">			            <a @click="saveBankInfo"  class="weui_btn  btn2">保存</a>			        </p>			         <p class="weui_btn_area">			            <a @click="showType=1"  class="weui_btn weui_btn_plain_default">取消</a>			        </p>			    </div>           </form></div>';
});

define("./template_js/billsRecords", [], function(require, exports, module) {
    return '<div class="page-content">	      <section>    	<div class="weui_cells_title">    		<span class="fl">历史账单明细</span>    	     		<div class="clear"></div>    	</div>    	  <section class="errormsgDiv" v-if="nodata==1">	    <p class="errormsg">（￣︶￣）/</p>	    <p class="errormsg2">暂无历史账单</p>	  </section>    	<div class="weui_cells weui_cells_checkbox" v-else>	        <label class="weui_cell weui_check_label"  v-for="item in bills_list" >	            <div class="weui_cell_hd">	                <input type="checkbox" class="weui_check" name="checkbox1"  @click="countPrice"  :data-bill_entry_id="item.bill_entry_id" :data-bill_entry_amount="item.amount">	                <i class="weui_icon_checked"></i>	            </div>	            <div class="weui_cell_bd weui_cell_primary">	            	  <div class="fl">	            	  	 <p>支付 [{{item.provider_shop.name}}] {{item.amount}} 元</p>		                  <p class="light">订单号{{item.order_sn}} ，订单交易额￥{{item.order_amount}}，佣金比例{{item.commission}}</p>		                  <p class="light">{{item.createtime}}</p>		                 	            	  </div>	            	   <div class="fr">	            	  	 <p align="right"><strong>{{item.bill_entry_amount}}</strong></p>		                 <div align="right" style="    color: #c00; margin-top: 5px">{{item.statusText}}</div> 	            	  </div>	            	  <div class="clear"></div>	                  	            </div>	        </label>	        	    </div>	    <div style="height: 80px"></div>    </section> </div>';
});

define("./template_js/bindScanBox", [], function(require, exports, module) {
    return '<div class="page-content">    <div class="item" >		    		    <div class=\'light\'>使用支付盒子扫二维码绑定商户信息</div>		    		    <div class="qrcode" v-if="show_qrcode_url">		    	  <img :src="show_qrcode_url" style="min-width: 200px">		    </div>		   		     		      		      		    </div>		          </div></div>';
});

define("./template_js/book", [], function(require, exports, module) {
    return '<div class="page-content">	 <router-link :to="{ name: \'addBook\', params: { shop_id: shop_id , id:0}}"  class="new-cate-item color_0 s_left" >+新建</router-link>	  <!-- <a  @click="preview"  class="new-cate-item color_0 s_left" >预览</a> -->          <a @click="shareUrl"  class="new-cate-item s_left color_0" >分享链接</a>	  	  	  <div class="clear"></div>     <div class="cate-item" v-for="item in items">     	 <div class="cate-item-in">     	   	  <div class="cate-name">{{item.name}}（{{item.remark}}）</div>     	      <div class="cate-goods text-over-hidden">     	      	  <span class="s_left">¥ {{item.money}} </span>     	      	  <span class="s_right">       	      	  	<router-link :to="{ name: \'addBook\', params: { shop_id: shop_id , id:item.id}}"  class="color_0 s_left" >修改</router-link>     	      	  	<a @click="delBook(item.id)"  class="color_0 s_left" style="margin-left: 10px">删除</a>     	      	  </span>     	      	   <div class="clear"></div>     	      </div>    	 </div>     </div>      </div>';
});

define("./template_js/chooseGoods", [], function(require, exports, module) {
    return '<div class="page-content newCate-content">	     <div class="box-tip light">搜索商品</div>     <div class="list-li">          <div class="li"  >               <select name="tag_name" class="form-control" id="tag_name" style="width: 100%">                       <option  value="">请输入分类名称</option>                    <option v-for="tag in tags"  :value="tag.id">{{tag.name}}</option>               </select>           </div>      </div>           <div class="list-li goods-list" >             <div class="weui_cells weui_cells_checkbox">                    <label class="weui_cell weui_check_label"  v-for="good,index in goods"  :for="index">                        <div class="weui_cell_hd">                            <input type="checkbox" v-if="good.choose" class="weui_check" checked  @click="tag($event,good.id)" name="checkbox1" :id="index">                             <input type="checkbox" v-else  class="weui_check" @click="tag($event,good.id)" name="checkbox1" :id="index">                            <i class="weui_icon_checked"></i>                        </div>                        <div class="weui_cell_bd weui_cell_primary">                              <div class="li" >                              <div class="li-input-text">                                  <img :src="good.default_img+\'?imageView2/1/w/160/h/160\'">                              </div>                              <div class="li-input">{{good.goods_name}}</div>                              <div class="clear"></div>                           </div>                         </div>                    </label>                                                                 </div>       </div>        </div>';
});

define("./template_js/goods", [], function(require, exports, module) {
    return '<div class="page-content">       <div mode="selector" bindchange="bindChange"    class="shop-header background_color_1">      <div class="s_left">         <span class="shop-title color_1" >{{shop_info.name}}</span>        </div>       <a @click="newGoods"    class="s_right color_0" >添加商品</a>       <div class="clear"></div>    </div>    <!-- 左边导 -->    <div class=\'good-tabs tabs\'>      <div class="scroll_div">                   <div  v-for="(attr,idx) in tag_list" @click=\'showTabs(idx)\' :class="idx==tabid?\'li on\':\'li\'" :data-id="idx">{{attr.name}}</div>                 </div>      </div><!-- 右边商品 -->     <div class="good-contents tab-contents">                    <div v-for="(attr,idx) in tag_list" :class="idx==tabid?\'tab-content\':\'hidden\'" >                                                        <!-- 商品列表开始 -->                  <div class="goods-item-1" :data-attr_id="attr.id">                                                                                                      <div class="goods-item" v-if="goods[attr.id]" v-for="(item,idx2) in goods[attr.id]">                     <div class="goods-item-img"> <img mode=\'widthFix\'  :src="item.default_img+\'?imageview2/1/w/160/h/160\'"/></div>                     <div class="goods-item-info">                          <div class="goods_title">{{item.goods_name}}</div>                          <!-- <div class="light" >{{item.sub_title}}</div> -->                          <div class="price s_left">¥{{item.price}}</div><!-- 操作购物车 -->                        <div class=" s_right">                             <i class="icon iconfont   s_left" @click="deleteRowMallGoods(attr.id,idx2,item.id)"> {{item.status==1?\'下架\':\'上架\'}}</i>                          <i  class="icon iconfont  s_left" @click="editGoods(item.id)" style="margin-left: 5px;"> 编辑</i>                         </div><!-- 操作购物车 -->                     </div>                     <div class="clear"></div>                   </div>                 <!-- 商品列表结束-->                                    </div>                  <div style=\'height:100px\'></div>              </div>       </div>      <!-- 结束商品 --> </div>';
});

define("./template_js/index", [], function(require, exports, module) {
    return '<div class="page-content">	 <router-link :to="{ name: \'newCate\', params: { shop_id: shop_id , type:type, id:0}}"  class="new-cate-item color_0 s_left" >+新建分类</router-link>	  <!-- <a  @click="preview"  class="new-cate-item color_0 s_left" >预览</a> -->	   <a @click="shareUrl"  class="new-cate-item s_left color_0" >分享链接</a>	  <a @click="eat_in_hall_pay_setting"  v-if="type==2" class="new-cate-item s_right color_2" >消费模式设置</a>	 	  <a @click="freight_setting"  v-if="type==1" class="new-cate-item s_right color_2" >配送设置</a>	  	  <div class="clear"></div>     <router-link :to="{ name: \'newCate\', params: { shop_id: shop_id , type:type, id:item.id}}" class="cate-item" v-for="item in items">     	 <div class="cate-item-in">     	   	  <div class="cate-name">{{item.name}}（{{item.goods_count}}）</div>     	      <div class="cate-goods text-over-hidden">{{item.goods_names}}</div>    	 </div>     </<router-link>      </div>';
});

define("./template_js/merchantInfo", [], function(require, exports, module) {
    return '<div class="page-content">	<section v-if="showType==1">	<div class="weui_cells_title">商户信息</div>	  <div class="weui_cells">	  			   <div style="text-align: center;"><img style="    width: 70px;padding: 10px;" :src="storeData.logo"></div>		  				  				 <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{MerchantName}}</p>                        </div>                        <div class="weui_cell_ft">                            商户名                        </div>                                             </div>                    <div class="weui_cell" v-if="merchantInfo.BussAuthNum">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{merchantInfo.BussAuthNum}}</p>                        </div>                        <div class="weui_cell_ft">                            营业执照号                        </div>                                             </div>                    <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{merchantInfo.Alias}}</p>                        </div>                        <div class="weui_cell_ft">                            简称                        </div>                                             </div>                     <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{merchantInfo.ContactName}}</p>                        </div>                        <div class="weui_cell_ft">                            联系人                        </div>                                             </div>                     <div class="weui_cell">                        <div class="weui_cell_bd weui_cell_primary">                            <p>{{merchantInfo.ContactMobile}}</p>                        </div>                        <div class="weui_cell_ft">                            联系电话                        </div>                                             </div>                                                        </div>                 <div class="weui_opr_area" >			        <p class="weui_btn_area">			            <a v-on:click="showType=2" class="weui_btn  btn2">修改商户信息</a>			            			        </p>			    </div>    </section>    <form id="InfoForm" :style="showType==1?\'display: none;\':\'\'"   >      	<div class="weui_cells_title">商户基本信息</div>		   	 <div class="list-li"> 				  <div class="weui_cell">		                <div class="weui_cell_hd"><label style="width: 76px;" class="weui_label">logo</label></div>		                <div class="weui_cell_bd weui_cell_primary">		                      <textarea name="imgs"  style="display:none">{{logoString}}</textarea>		         			  <div class="" id="storeLogo" for="logo" name="storeLogo" :data-image="storeData.logo"   upload="1"></div>		                     <input type="hidden" name="store_id" :value="storeData.store_id">		                    <input type="hidden" name="logo" :value="storeData.logo">		                </div>		            </div>			         <div class="li"  >	            	<div class="li-input-text">商户简称</div>		            <div class="li-input">		              <input  maxlength="20" placeholder=\'请输入商户简称\'  :value="merchantInfo.Alias"  name=\'Alias\'></input>		            </div>		            <div class="clear"></div>	         	 </div> 	         	   	         	   <div class="li"  >	            	<div class="li-input-text">省市区</div>		            <div class="li-input">		             <!--  <select  id="province_name"  class=" fl province form-control" style="width:33%;"  name="Province" >								<option value="">请选择</option>							</select>							<select  id="city_name" class=" fl city form-control" style="width:33%;" name="City">								<option value="">请选择</option>							</select>							<select id="county_name" class=" fl county form-control" style="width:33%;" name="District">								<option value="">请选择</option>							</select>							<input type="hidden" class="hide-value" name="DestinationAreaHideCode"   :value="merchantInfo.District"   /> -->							<input type="text" name="DestinationArea" id="DestinationArea" :value="merchantInfo.areaNames"  >							<input type="hidden"  name="Province"  id="Province" :value="merchantInfo.Province">							<input type="hidden" name="City" id="City" :value="merchantInfo.City">							<input type="hidden" name="District"  id="District"  :value="merchantInfo.District">							 		            </div>		            <div class="clear"></div>	         	 </div> 	         	   <div class="li"  >	            	<div class="li-input-text">详细地址</div>		            <div class="li-input">		              <input  maxlength="120" placeholder=\'请输入详细地址\'   :value="merchantInfo.Address"   name=\'Address\'></input>		            </div>		            <div class="clear"></div>	         	 </div> 	         	 <div class="li"  >	            	<div class="li-input-text">联系人</div>		            <div class="li-input">		            	  		              <input  maxlength="11"  placeholder=\'请输入联系人\'  :value="merchantInfo.ContactName"   name=\'ContactName\'></input>		            </div>		            <div class="clear"></div>	         	 </div> 	         	 <div class="li"  >	            	<div class="li-input-text">客服电话</div>		            <div class="li-input">		            	   <input type="hidden" name="MerchantId" :value="MerchantId">		              <input  maxlength="11"  placeholder=\'请输入客服电话\'  :value="merchantInfo.ContactMobile"   name=\'ContactMobile\'></input>		            </div>		            <div class="clear"></div>	         	 </div> 		 			   </div>			    <div class="weui_opr_area" >			        <p class="weui_btn_area">			            <a @click="updateMerchantInfo"  class="weui_btn  btn2">保存</a>			        </p>			         <p class="weui_btn_area">			            <a @click="showType=1"  class="weui_btn weui_btn_plain_default">取消</a>			        </p>			    </div>           </form></div>';
});

define("./template_js/newCate", [], function(require, exports, module) {
    return '<div class="page-content newCate-content">       <div class="box-tip light">分类名称</div>     <div class="list-li">          <div class="li"   v-if="editData && editData.id">                            <input  name="tag_name" @blur="saveTagByInput" class="form-control" id="tag_name" style="width: 100%" :value="editData.name">                          </div>           <div class="li" v-else>             <select name="tag_name" class="form-control" id="tag_name" style="width: 100%">                       <option  value="">请输入分类名称</option>                    <option v-for="tag in tags"  :value="tag.id">{{tag.name}}</option>               </select>           </div>                            </div>     <div>     <div class="box-tip light">排序</div>         <div class="list-li">          <div class="li"   >                                    <input type="number" placeholder="数字越小越前"  name="order_by" @blur="saveTagByInput" class="form-control" id="order_by" style="width: 100%" :value="editData.order_by">                                  </div>     </div>      <div v-if="id>0">          <div class="box-tip light">商品列表</div>           <div class="list-li">                <router-link class="li color_0"  :to="{ name: \'chooseGoods\', params: { shop_id: shop_id ,  id:id}}"  class="new-cate-item color_0" >+添加商品</router-link>           </div>          <div class="list-li goods-list">                <div class="li"  v-for="good,index in goods"  @click="showAct(good.id,index)">                  <div class="li-input-text">                      <img :src="good.default_img+\'?imageView2/1/w/160/h/160\'">                  </div>                  <div class="li-input">{{good.goods_name}}</div>                  <div class="clear"></div>               </div>           </div>      </div>          <div style="padding: 20px 10px;"  v-if="id>0">             <div class="btn btn3 w100 mgt10" @click="delTag" >删除此分类</div>         </div>  </div>';
});

define("./template_js/providerShopbill", [], function(require, exports, module) {
    return '<div class="page-content"> <div class="tab">   <div   v-on:click=\'setStatus("")\'  :class="status===\'\'?\'tabli on\':\'tabli\'"><span>全部</span></div>   <div   v-on:click=\'setStatus(0)\'   :class="status===0?\'tabli on\':\'tabli\'"><span>待支付</span></div>   <div  v-on:click=\'setStatus(1)\'  :class="status==1?\'tabli on\':\'tabli\'"><span>已支付</span></div>   <div   v-on:click=\'setStatus(2)\'   :class="status==2?\'tabli on\':\'tabli\'"><span>已关闭</span></div></div>    <section>    	     	  <section class="errormsgDiv" v-if="nodata==1">	    <p class="errormsg">（￣︶￣）/</p>	    <p class="errormsg2">暂无记录</p>	  </section>    	<div style="margin-top: 0px" class="weui_cells weui_cells_checkbox" v-else>	        <label class="weui_cell weui_check_label"  v-for="item in bills_list" >	            	            <div class="weui_cell_bd weui_cell_primary">	            	  <div class="fl">	            	  	 <p>[{{item.shop.name}}] 应付 {{item.amount}} 元</p>		                  <p class="light">订单号{{item.order_sn}} ，订单交易额￥{{item.order_amount}}，佣金比例{{item.commission}}</p>		                  <p class="light">		                  <span class="s_left">  {{item.createtime}} </span> <span class="s_right"> {{item.statusText}}</span>		                   <div class="clear"></div>		                 </p>		                 	            	  </div>	            	  	            	 	                  	            </div>	        </label>	        	    </div>	    <div style="height: 80px"></div>    </section> </div>';
});

define("./template_js/shareLink", [], function(require, exports, module) {
    return '<div class="page-content">    <div class="item"  v-if="shop_info">		    <div class="logo"><img :src="shop_info.logo"></div>		    <div class=\'light\'>{{shop_info.name}}</div>		    <!-- <div class=\'title mgt10\'>{{shop_info.name}}</div> -->		    <div class="qrcode">		    	  <img :src="show_qrcode_url" style="min-width: 200px">		    </div>		   		    <div class=\'info light\'>{{shop_info.fulladdress}}</div>		    		    <div >		       <a :href="downUrl"  class="btn">免费申请门店名片</a>		       <div    id="shareClipboard" :data-clipboard-text="url"  class="btn btn2">分享给好友</div>		    </div>		          </div></div>';
});

define("./template_js/shareUrl", [], function(require, exports, module) {
    return '<div class="page-content">    <div class="item" >		    		    <div class=\'light\'>扫二维码或复制链接</div>		    		    <div class="qrcode" v-if="show_qrcode_url">		    	  <img :src="show_qrcode_url" style="min-width: 200px">		    </div>		    		       <div  id="shareClipboard" :data-clipboard-text="url"  class="btn btn2">复制链接分享</div>		        <a :href="url"  class="btn">打开链接</a>		    </div>		          </div></div>';
});

define("./template_js/shopQCode", [], function(require, exports, module) {
    return '<div class="page-content">    <div class="item"  v-if="shop_info">		    <div class="logo"><img :src="shop_info.logo"></div>		    <div class=\'light\'>{{shop_info.name}}</div>		    <!-- <div class=\'title mgt10\'>{{shop_info.name}}</div> -->		    <div class="qrcode">		    	  <img :src="show_qrcode_url" style="min-width: 200px">		    </div>		   		    <div class=\'info light\'>{{shop_info.fulladdress}}</div>		    		    <div >		       <!-- <a :href="downUrl"  class="btn">免费申请门店名片</a> -->		       <div    id="shareClipboard" :data-clipboard-text="url"  class="btn btn2">复制链接分享给好友</div>		    </div>		          </div></div>';
});

define("./template_js/shopbill", [], function(require, exports, module) {
    return '<div class="page-content">    <section>    	<div class="weui_cells_title">    		<span class="fl">账单明细</span>    		 <router-link  :to="{ name: \'billsRecords\', params: { shop_id: shop_id }}"  class="fr green" style="color: #3CC51F">历史账单</router-link>    		<div class="clear"></div>    	</div>	   <section class="errormsgDiv" v-if="nodata==1">	    <p class="errormsg">（￣︶￣）/</p>	    <p class="errormsg2">暂无可缴费账单</p>	  </section>		     	<div class="weui_cells weui_cells_checkbox" v-else>	        <label class="weui_cell weui_check_label"  v-for="item in bills_list" >	            <div class="weui_cell_hd">	                <input type="checkbox" class="weui_check" name="checkbox1"  @click="countPrice"  :data-bill_entry_id="item.id" :data-bill_entry_amount="item.amount">	                <i class="weui_icon_checked"></i>	            </div>	            <div class="weui_cell_bd weui_cell_primary">	            	  <div class="fl">	            	  	 <p>支付 [{{item.provider_shop.name}}] 推广金 {{item.amount}} 元</p>		                  <p class="light">订单号{{item.order_sn}} ，订单交易额￥{{item.order_amount}}，佣金比例{{item.commission}}</p>		                  <p class="light">{{item.createtime}}</p>		                 	            	  </div>	            	   <div >	            	  	 <p class="s_left"><strong>{{item.amount}}</strong></p>		                 <div class="s_right" v-if="item.status == 0" style="    color: #c00; margin-top: 5px">待支付</div> 		                  <div class="clear"></div>	            	  </div>	            	 	                  	            </div>	        </label>	        	    </div>	    <div style="height: 80px"></div>    </section>      <!-- 支付 -->  <section class="bottom-fixed">       <div class="fl">      	<div class="weui_cells_checkbox">     		<label class="weui_cell weui_check_label" >	            <div class="weui_cell_hd">	                <input type="checkbox" class="weui_check" @click="selectAll" name="checkbox2" >	                <i class="weui_icon_checked"></i>	            </div>	            <div class="weui_cell_bd weui_cell_primary">	                <p>全选  合计：<strong  style=" color: #c00;">{{bill_amount}}</strong></p>	            </div>	        </label>     	</div>    </div>             <div class="fr">       <div :class="bill_amount>0?\'join-btn\':\'join-btn disable\'" v-on:click="postOrder"> <div class="btn publish-btn">确认支付</div></div>     </div>   </section></div>';
});

define("./template_js/stmtPayResultQuery", [], function(require, exports, module) {
    return '<div class="page-content">   <header class="header"><label for="time">                      <div class="picker">              <span class="light mg0" v-if="queryTime==\'\'">最近5天</span>              <span v-else>{{queryTime+"(前5天数据)"}}</span>             </div>             <input type="text" class="hidden" name="" id="time">                 </label>    </header>    <section>	   <section class="errormsgDiv" v-if="nodata==1">	    <p class="errormsg">（￣︶￣）/</p>	    <p class="errormsg2">暂无记录</p>	  </section>		     	<div class="weui_cells weui_cells_checkbox" v-else>	        <label class="weui_cell weui_check_label"  v-for="item in list" >	             	            <div class="weui_cell_bd weui_cell_primary" v-if="item.status">	            	  <div class="fl">	            	  	 <p>{{item.amount}} 元</p>		                  <!-- <p class="light">单号{{item.orderNo}}</p> -->		                  <p class="light">{{item.payTime}}</p>	            	  </div>	            	   <div >	            	  	 		                 <div class="s_right"  style="color: #c00; margin-top: 5px">{{item.status}}</div> 		                  <div class="clear"></div>	            	  </div>	            </div>	            <div class="weui_cell_bd weui_cell_primary" v-else>	            	  <div class="fl">	            	  	 <p>{{item.tradeDate}} 无记录</p>		                 	            	  </div>	            	   <div >	            	  	  <div class="s_right"  style="color: #c00; margin-top: 5px">{{item.msg}}</div> 		                  <div class="clear"></div>		               		                 	            	  </div>	            </div>	        </label>	        	    </div>	    <div style="height: 80px"></div>    </section></div>';
});

define("./template_js/updateStore", [], function(require, exports, module) {
    return '<div class="page-content">		<form  id="formNewBook"  >		     <div class="weui_cells weui_cells_form">		     	  		       <div class="weui_cell">		                <div class="weui_cell_hd"><label style="width: 76px;" class="weui_label">logo</label></div>		                <div class="weui_cell_bd weui_cell_primary">		                      <textarea name="imgs"  style="display:none">{{logoString}}</textarea>		         			  <div class="" id="storeLogo" for="logo" name="storeLogo" :data-image="editData.logo"   upload="1"></div>		                    		                </div>		            </div>		            <div class="weui_cell">		                <div class="weui_cell_hd"><label style="width: 76px;" class="weui_label">商户名称</label></div>		                <div class="weui_cell_bd weui_cell_primary">		                    <input class="weui_input" type="text" name="store_name" :value="editData.store_name" placeholder="请输入名称">		                    <input type="hidden" name="store_id" :value="editData.store_id">		                    <input type="hidden" name="logo" :value="editData.logo">		                    		                </div>		            </div>		            		        </div>		    <div style="padding: 20px 10px;">		    	<div class="btn btn2 w100" @click=\'save()\'>保存</div>  		    	 		     	 		   </div>      		</form></div>';
});
